Build Project and Upload Artifact #853
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: 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 changelog | |
run: | | |
echo "return [[" > ${{github.workspace}}/repentogon/resources/scripts/repentogon_extras/changelog_official_text.lua | |
git log -n 10 --pretty=format:"%h (%an)%n* %s%n/fade/%b%n/newline/" >> ${{github.workspace}}/repentogon/resources/scripts/repentogon_extras/changelog_official_text.lua | |
echo "]]" >> ${{github.workspace}}/repentogon/resources/scripts/repentogon_extras/changelog_official_text.lua | |
echo "Resulting lua file:" | |
type ${{github.workspace}}/repentogon/resources/scripts/repentogon_extras/changelog_official_text.lua | |
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 | |
(gc ${{github.workspace}}/launcher/Updater.cpp) -replace 'std::string version = "dev build";', 'std::string version = "nightly-$sha";' | Out-File -encoding ASCII ${{github.workspace}}/launcher/Updater.cpp | |
- 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 | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: REPENTOGON-main | |
path: ${{github.workspace}}/build/Release/artifact/ | |
retention-days: 30 |