build(ci): macos arm64 (#134)

Co-authored-by: xensik <xensik@pm.me>
This commit is contained in:
Edo 2023-06-25 16:48:45 +02:00 committed by GitHub
parent 4973ceceb1
commit 3ac5ce54d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 54 deletions

View File

@ -16,14 +16,13 @@ concurrency:
cancel-in-progress: true
jobs:
build-win:
build-windows:
name: Build Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration:
- debug
config:
- release
arch:
- x86
@ -35,7 +34,7 @@ jobs:
platform: x64
steps:
- name: Check out files
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0
@ -55,40 +54,30 @@ jobs:
- name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/gsc-tool.sln
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} build/gsc-tool.sln
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
uses: actions/upload-artifact@v3.1.2
with:
name: Windows ${{matrix.configuration}} ${{matrix.arch}} binaries
name: windows-${{matrix.arch}}-${{matrix.config}}
path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/gsc-tool.exe
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool.exe
build-mac:
build-macos:
name: Build macOS
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
configuration:
- debug
config:
- release
arch:
- x64
- ARM64
include:
- configuration: debug
config: debug
- configuration: release
config: release
- arch: x64
platform: x64
- arch: ARM64
platform: arm64
- arm64
steps:
- name: Check out files
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0
@ -105,39 +94,31 @@ jobs:
- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
run: |
pushd build
make config=${{matrix.config}}_${{matrix.platform}} -j$(sysctl -n hw.logicalcpu)
make config=${{matrix.config}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu)
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
uses: actions/upload-artifact@v3.1.2
with:
name: macOS ${{matrix.configuration}} ${{matrix.arch}} binaries
name: macos-${{matrix.arch}}-${{matrix.config}}
path: |
build/bin/${{matrix.platform}}/${{matrix.configuration}}/gsc-tool
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
build-lin:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configuration:
- debug
config:
- release
arch:
- x64
include:
- configuration: debug
config: debug
- configuration: release
config: release
- arch: x64
platform: x64
steps:
- name: Check out files
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.3
with:
submodules: true
fetch-depth: 0
@ -157,7 +138,7 @@ jobs:
- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master
- name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries
- name: Build ${{matrix.arch}} ${{matrix.config}} binaries
run: |
pushd build
make config=${{matrix.config}}_${{matrix.arch}} -j$(nproc)
@ -165,26 +146,26 @@ jobs:
CC: clang
CXX: clang++
- name: Upload ${{matrix.configuration}} ${{matrix.arch}} binaries
- name: Upload ${{matrix.arch}} ${{matrix.config}} binaries
uses: actions/upload-artifact@v3.1.2
with:
name: Linux ${{matrix.configuration}} ${{matrix.arch}} binaries
name: linux-${{matrix.arch}}-${{matrix.config}}
path: |
build/bin/${{matrix.platform}}/${{matrix.configuration}}/gsc-tool
build/bin/${{matrix.arch}}/${{matrix.config}}/gsc-tool
deploy:
name: Deploy Release
runs-on: ubuntu-latest
needs: [ build-win, build-mac, build-lin ]
needs: [ build-windows, build-macos, build-linux ]
if: startsWith(github.ref, 'refs/tags/') && (github.event.base_ref == 'refs/heads/prod' || github.event.base_ref == 'refs/heads/dev')
steps:
- name: Check out files
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
- name: Download Binaries
uses: actions/download-artifact@v3
uses: actions/download-artifact@v3.0.2
with:
name: Windows release x64 binaries
name: windows-x64-release
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"

View File

@ -84,10 +84,10 @@ workspace "gsc-tool"
configurations { "debug", "release" }
if os.istarget("darwin") then
if os.istarget("linux") or os.istarget("darwin") then
platforms { "x64", "arm64" }
else
platforms { "x86", "x64" }
platforms { "x86", "x64", "arm64" }
end
filter "platforms:x86"
@ -116,10 +116,6 @@ workspace "gsc-tool"
systemversion "latest"
filter {}
filter { "system:macosx" }
systemversion "12.0"
filter {}
symbols "On"
staticruntime "On"
warnings "Extra"
@ -129,9 +125,16 @@ workspace "gsc-tool"
linkoptions "-pthread"
end
if os.istarget("darwin") then
filter "platforms:arm64"
buildoptions "-arch arm64"
linkoptions "-arch arm64"
filter {}
end
filter "configurations:release"
optimize "Full"
defines { "NDEBUG" }
defines "NDEBUG"
flags { "FatalCompileWarnings" }
filter {}