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

View File

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