working for 2.1 #22
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: 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 | |
- uses: ilammy/[email protected] | |
with: | |
arch: amd64 | |
- name: Configure CMake | |
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CI_BUILD=ON -DGITHUB_ENV="$env:GITHUB_ENV" -G Ninja | |
- 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 | |
git-cliff --current --strip header -o ${{ env.CHANGELOG_FILE }} | |
cat requirements.md >> ${{ 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_debug | |
run: tar -cvf "${{ github.workspace }}/${{ env.MOD_SLUG }}_${{ github.ref_name }}_pdb.zip" --format=zip * | |
working-directory: game_dir_debug | |
- name: Check file existence | |
id: requirements_folder_exists | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "game_dir_requirements" | |
- name: Check file existence | |
id: requirements_debug_folder_exists | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "game_dir_requirements_debug" | |
- name: Zipping game_dir_requirements | |
if: steps.requirements_folder_exists.outputs.files_exists == 'true' | |
run: tar -cvf "${{ github.workspace }}/${{ env.MOD_SLUG }}_${{ github.ref_name }}_requirements.zip" --format=zip * | |
working-directory: game_dir_requirements | |
- name: Zipping game_dir_requirements_debug | |
if: steps.requirements_debug_folder_exists.outputs.files_exists == 'true' | |
run: tar -cvf "${{ github.workspace }}/${{ env.MOD_SLUG }}_${{ github.ref_name }}_requirements_pdb.zip" --format=zip * | |
working-directory: game_dir_requirements_debug | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ github.ref_name }}${{ env.CYBERPUNK_2077_GAME_VERSION_STR }} | |
body_path: ${{ env.CHANGELOG_FILE }} | |
append_body: true | |
files: | | |
${{ env.MOD_SLUG }}_${{ github.ref_name }}.zip | |
${{ env.MOD_SLUG }}_${{ github.ref_name }}_requirements.zip | |
${{ env.MOD_SLUG }}_${{ github.ref_name }}_pdb.zip | |
${{ env.MOD_SLUG }}_${{ github.ref_name }}_requirements_pdb.zip | |
prerelease: ${{ contains(github.ref_name, '-') || contains(github.ref_name, '_') }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |