build: update workflow

This commit is contained in:
6arelyFuture 2024-02-19 22:41:32 +01:00
parent bbd7869fde
commit c188aaffde
Signed by: Future
GPG Key ID: FA77F074E98D98A5
2 changed files with 27 additions and 25 deletions

View File

@ -13,6 +13,9 @@ concurrency:
group: ${{ github.ref }} group: ${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
env:
PREMAKE_VERSION: "5.0.0-beta2"
jobs: jobs:
build-windows: build-windows:
name: Build Windows name: Build Windows
@ -21,7 +24,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
configuration: configuration:
- Release - debug
- release
arch: arch:
- x64 - x64
include: include:
@ -29,19 +33,19 @@ jobs:
platform: x64 platform: x64
steps: steps:
- name: Check out files - name: Check out files
uses: actions/checkout@v4 uses: actions/checkout@main
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
lfs: false lfs: false
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1 uses: microsoft/setup-msbuild@main
- name: Install Premake5 - name: Install Premake5
uses: abel0b/setup-premake@v2.3 uses: abel0b/setup-premake@v2.3
with: with:
version: "5.0.0-beta2" version: ${{ env.PREMAKE_VERSION }}
- name: Generate project files - name: Generate project files
run: premake5 vs2022 run: premake5 vs2022
@ -49,13 +53,13 @@ jobs:
- name: Set up problem matching - name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master uses: ammaraskar/msvc-problem-matcher@master
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/iw4-validator.sln run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/iw4-validator.sln
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.3 uses: actions/upload-artifact@main
with: with:
name: Windows ${{matrix.configuration}} ${{matrix.arch}} binaries name: windows-${{matrix.arch}}-${{matrix.configuration}}
path: | path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.exe build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.exe
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.pdb build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator.pdb
@ -67,16 +71,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
configuration: configuration:
- Release - debug
- release
arch: arch:
- x64 - x64
- arm64 - arm64
include:
- configuration: Release
config: release
steps: steps:
- name: Check out files - name: Check out files
uses: actions/checkout@v4 uses: actions/checkout@main
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
@ -91,7 +93,7 @@ jobs:
- name: Install Premake5 - name: Install Premake5
uses: abel0b/setup-premake@v2.3 uses: abel0b/setup-premake@v2.3
with: with:
version: "5.0.0-beta2" version: ${{ env.PREMAKE_VERSION }}
- name: Generate project files - name: Generate project files
run: premake5 gmake2 run: premake5 gmake2
@ -109,15 +111,15 @@ jobs:
run: | run: |
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
run: | run: |
pushd build pushd build
make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc) make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.3 uses: actions/upload-artifact@main
with: with:
name: Linux ${{matrix.configuration}} ${{matrix.arch}} binaries name: linux-${{matrix.arch}}-${{matrix.configuration}}
path: | path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator build/bin/${{matrix.arch}}/${{matrix.configuration}}/iw4-validator
@ -132,13 +134,13 @@ jobs:
run: echo "ALTERWARE_MASTER_PATH=${{ secrets.ALTERWARE_MASTER_SSH_PATH }}" >> $GITHUB_ENV run: echo "ALTERWARE_MASTER_PATH=${{ secrets.ALTERWARE_MASTER_SSH_PATH }}" >> $GITHUB_ENV
- name: Download Release binaries - name: Download Release binaries
uses: actions/download-artifact@v3.0.2 uses: actions/download-artifact@main
with: with:
name: Windows Release x64 binaries name: windows-x64-release
# Set up committer info and GPG key # Set up committer info and GPG key
- name: Install SSH key - name: Install SSH key
uses: shimataro/ssh-key-action@v2.6.1 uses: shimataro/ssh-key-action@v2.7.0
with: with:
key: ${{ secrets.ALTERWARE_MASTER_SSH_PRIVATE_KEY }} key: ${{ secrets.ALTERWARE_MASTER_SSH_PRIVATE_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors' known_hosts: 'just-a-placeholder-so-we-dont-get-errors'

View File

@ -4,7 +4,7 @@ location "./build"
objdir "%{wks.location}/obj" objdir "%{wks.location}/obj"
targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}" targetdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}"
configurations {"Debug", "Release"} configurations {"debug", "release"}
if os.istarget("darwin") then if os.istarget("darwin") then
platforms {"x64", "arm64"} platforms {"x64", "arm64"}
@ -50,13 +50,13 @@ end
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"} flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"}
filter "configurations:Release" filter "configurations:release"
optimize "Speed" optimize "Speed"
defines "NDEBUG" defines "NDEBUG"
flags "FatalCompileWarnings" flags "FatalCompileWarnings"
filter {} filter {}
filter "configurations:Debug" filter "configurations:debug"
optimize "Debug" optimize "Debug"
defines {"DEBUG", "_DEBUG"} defines {"DEBUG", "_DEBUG"}
filter {} filter {}