Fix version in GitHub release workflow. #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ${{ github.ref_name != 'main' }} | |
fail_on_unmatched_files: true | |
files: | | |
kdeck-Linux64-${{ github.ref_name }}.tar.gz |