Build Project and Upload Artifact #1656
This file contains hidden or 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: Build Project and Upload Artifact | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: 'true' | |
| fetch-depth: 0 | |
| - name: Generate version info | |
| run: | | |
| echo "#pragma once" > ${{github.workspace}}/repentogon/Version.h | |
| $sha = git rev-parse --short HEAD | |
| echo "#define VERSION `"nightly-$sha`"" >> ${{github.workspace}}/repentogon/Version.h | |
| (gc ${{github.workspace}}/repentogon/resources/scripts/main_ex.lua) -replace 'dev build', "nightly-$sha" | Out-File -encoding ASCII ${{github.workspace}}/repentogon/resources/scripts/main_ex.lua | |
| - name: Configure CMake | |
| run: cmake -G "Visual Studio 17 2022" -A "Win32" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| - name: Create Artifact Folder | |
| shell: powershell | |
| run: | | |
| cd ${{github.workspace}}/build/Release | |
| mkdir artifact | |
| mv resources artifact | |
| mv resources-repentogon artifact | |
| if (Test-Path dsound.dll) { mv dsound.dll artifact } | |
| if (Test-Path launcher.dll) { mv launcher.dll artifact } | |
| if (Test-Path injector.exe) { mv injector.exe artifact } | |
| mv libzhl.dll artifact | |
| mv zhlREPENTOGON.dll artifact | |
| mv Lua5.4.dll artifact | |
| mv freetype.dll artifact | |
| cp ${{github.workspace}}/changelog.txt artifact/rgon_changelog.txt | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: REPENTOGON-main | |
| path: ${{github.workspace}}/build/Release/artifact/ | |
| retention-days: 30 |