Skip to content

Build Project and Upload Artifact #1035

Build Project and Upload Artifact

Build Project and Upload Artifact #1035

Workflow file for this run

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
(gc ${{github.workspace}}/updater/Updater.cpp) -replace 'std::string version = "dev build";', 'std::string version = "nightly-$sha";' | Out-File -encoding ASCII ${{github.workspace}}/updater/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
cp ${{github.workspace}}/changelog.txt artifact/rgon_changelog.txt
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: REPENTOGON-main
path: ${{github.workspace}}/build/Release/artifact/
retention-days: 30