Merge pull request #4 from Flying-Tom/ci-fix #18
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: Windows Release | |
on: | |
push: | |
branches: | |
- main | |
- ci-fix | |
tags: | |
- "v*.*.*" | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v2 | |
with: | |
arch: "win64_mingw81" | |
- name: Configure CMake | |
run: cmake -G "MinGW Makefiles" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
run: cmake --build ${{github.workspace}}\build --config ${{env.BUILD_TYPE}} | |
- name: Pack Resources | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
mkdir ${{github.workspace}}\release | |
Xcopy ${{github.workspace}}\build\TDGame.exe ${{github.workspace}}\release | |
Xcopy /E /I ${{github.workspace}}\resource\maps ${{github.workspace}}\release\maps | |
cd ${{env.Qt5_Dir}}\bin\ | |
.\windeployqt.exe ${{github.workspace}}\release\TDGame.exe | |
- name: Archive Release | |
uses: thedoctor0/zip-release@0.7.5 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
type: "zip" | |
directory: ${{github.workspace}}/release/ | |
filename: "TDGame-Windows-${{github.ref_name}}.zip" | |
- name: Upload Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: "${{github.workspace}}/release/TDGame-windows-${{github.ref_name}}.zip" |