Skip to content

Commit

Permalink
Add release flow to GitHub Actions
Browse files Browse the repository at this point in the history
Initial support to automate release flow. Now after git tag of specific commit GitHub Actions will create a draft entry of release (named by tag) with source code package on it.
  • Loading branch information
winterheart committed Aug 12, 2024
1 parent 7337320 commit 03a3b92
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release source tarball
on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Generate git hash and tarball
run: |
sudo apt update
sudo apt install -y ninja-build cmake g++ libsdl2-dev zlib1g-dev
cmake --preset linux
cmake --build --preset linux -t get_git_hash
cmake --build --preset linux -t package_source
- name: Release
uses: ncipollo/[email protected]
with:
artifacts: "builds/linux/Descent3-*-Source.tar.xz"
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,17 @@ add_subdirectory(tools)
add_subdirectory(netcon)
add_subdirectory(netgames)
add_subdirectory(scripts)

# Packaging stuff
set(CPACK_SOURCE_GENERATOR "TXZ")
set(CPACK_SOURCE_IGNORE_FILES
".git/"
".github/"
".idea"
build[s]/
cmake-build-*
".*~$"
)
set(CPACK_VERBATIM_VARIABLES YES)
include(CPack)

0 comments on commit 03a3b92

Please sign in to comment.