build: cleanup CI workflow

This commit is contained in:
6arelyFuture 2024-01-12 12:09:41 +01:00
parent fe2aa6dd42
commit 60e757fd06
Signed by: Future
GPG Key ID: FA77F074E98D98A5
2 changed files with 40 additions and 39 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-win: build-win:
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@v3.5.3 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/alterware-master-tool.sln run: msbuild /m /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/alterware-master-tool.sln
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.2 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}}/alterware-master-tool.exe build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool.exe
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool.pdb build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool.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@v3.5.3 uses: actions/checkout@main
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
@ -91,26 +93,26 @@ 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 --cc=clang gmake2
- name: Set up problem matching - name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master uses: ammaraskar/gcc-problem-matcher@master
- 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)
env: env:
CC: clang CC: clang
CXX: clang++ CXX: clang++
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.2 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}}/alterware-master-tool build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool
@ -121,20 +123,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
- arch: x64
platform: x64
- arch: arm64
platform: arm64
steps: steps:
- name: Check out files - name: Check out files
uses: actions/checkout@v3.5.3 uses: actions/checkout@main
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
@ -143,7 +139,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
@ -151,14 +147,14 @@ jobs:
- name: Set up problem matching - name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master uses: ammaraskar/gcc-problem-matcher@master
- 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$(sysctl -n hw.logicalcpu) make config=${{matrix.configuration}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu)
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@v3.1.2 uses: actions/upload-artifact@main
with: with:
name: macOS ${{matrix.configuration}} ${{matrix.arch}} binaries name: macos-${{matrix.arch}}-${{matrix.configuration}}
path: | path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool build/bin/${{matrix.arch}}/${{matrix.configuration}}/alterware-master-tool

View File

@ -36,7 +36,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"}
language "C++" language "C++"
cppdialect "C++14" cppdialect "C++14"
@ -76,12 +76,15 @@ filter { "system:linux", "system:macosx" }
filter {} filter {}
if os.istarget("linux") then if os.istarget("linux") then
filter { "platforms:arm64" } filter { "toolset:clang*", "platforms:arm64" }
buildoptions "--target=arm64-linux-gnu" buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu" linkoptions "--target=arm64-linux-gnu"
filter {} filter {}
linkoptions "-fuse-ld=lld" filter { "toolset:clang*" }
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
filter {}
end end
filter { "system:macosx", "platforms:arm64" } filter { "system:macosx", "platforms:arm64" }
@ -108,7 +111,9 @@ filter {}
project "alterware-master-tool" project "alterware-master-tool"
kind "ConsoleApp" kind "ConsoleApp"
language "C++" language "C++"
cppdialect "C++14"
targetname "alterware-master-tool" targetname "alterware-master-tool"