-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 2.62 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Debian Bookworm Release
on:
push:
# branches:
# - main
tags:
# NOTE: The tag name must conform to CMake's `project` command spec:
# See: https://cmake.org/cmake/help/latest/command/project.html#options
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
# allows manual execution of the workflow
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@e2a42bc9a15f8414a9078f38b702de2a2976733d # tag `v3`
with:
remove-android: 'true'
remove-cached-tools: 'true'
remove-codeql: 'true'
#remove-docker-images: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
remove-large-packages: 'true'
#remove-swapfile: 'true'
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
path: build/vcpkg_installed
save-always: true
- name: Build Docker image
run: docker build -t kdeck-build .
# NOTE: We use a bind-mount instead of a volume for the build dir
# because the runner user will not have permission to access
# an (automatically created) anonymous volume.
- name: Run build in Docker container
run: |
docker run \
-v "${{ github.workspace }}/build:/src/build" \
${{ github.ref_type == 'tag' && format('--env APP_VERSION={0}', github.ref_name) || '' }} \
kdeck-build
- name: Record hash
run: echo ${{ github.sha }} > release.txt
- name: Create tarball
run: |
tar -czvf "kdeck-Linux64-${{ github.ref_name }}.tar.gz" \
--directory="${{ github.workspace }}" \
release.txt \
LICENSE.md \
--directory="${{ github.workspace }}/build/bin/Linux64/Release" \
kdeck
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifact
compression-level: 0
if-no-files-found: error
path: kdeck-Linux64-${{ github.ref_name }}.tar.gz
- name: Release
if: ${{ github.ref_type == 'tag' }}
uses: softprops/action-gh-release@v2
with:
prerelease: true
fail_on_unmatched_files: true
files: |
kdeck-Linux64-${{ github.ref_name }}.tar.gz