Skip to content

Commit

Permalink
chore: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed May 6, 2023
1 parent 54f863b commit 2b449df
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Workflow

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
release:
name: Build & Release
runs-on: windows-latest
env:
GIT_CLIFF_VERSION: 0.10.0
CHANGELOG_FILE: ${{ github.workspace }}-CHANGES.md

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CI_BUILD=ON -DGITHUB_ENV="$env:GITHUB_ENV"

- name: Build
run: cmake --build ${{ github.workspace }}/build --config RelWithDebInfo

- name: Install git-cliff
uses: Alex079/setup-custom-tool@v1
with:
archiveUrl: https://github.com/orhun/git-cliff/releases/download/v${{ env.GIT_CLIFF_VERSION }}/git-cliff-${{ env.GIT_CLIFF_VERSION }}-x86_64-pc-windows-msvc.zip
archiveGlob: '*'
toolName: git-cliff
toolVersion: ${{ env.GIT_CLIFF_VERSION }}

- name: Generate a changelog
run: git cliff --current --strip header -o ${{ env.CHANGELOG_FILE }}

- name: Zipping game_dir
run: tar -cvf "${{ github.workspace }}/${{ env.MOD_SLUG }}_${{ github.ref_name }}.zip" --format=zip *
working-directory: game_dir

- name: Zipping game_dir_prereqs
run: tar -cvf "${{ github.workspace }}/${{ env.MOD_SLUG }}_${{ github.ref_name }}_prereqs.zip" --format=zip *
working-directory: game_dir_prereqs

- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ env.CHANGELOG_FILE }}
files: |
${{ env.MOD_SLUG }}_${{ github.ref_name }}.zip
${{ env.MOD_SLUG }}_${{ github.ref_name }}_prereqs.zip
prerelease: ${{ contains(github.ref_name, '-') || contains(github.ref_name, '_') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2b449df

Please sign in to comment.