Skip to content

Commit

Permalink
[CI/CD] Add macOS arm64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
taysta committed Sep 15, 2024
1 parent c3c4a5b commit 56014f0
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,70 @@ jobs:
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar
if-no-files-found: error

macos-arm64:
name: ${{ matrix.config }} macOS ${{ matrix.arch }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
arch: [arm64]
cc: [clang]
cxx: [clang++]
include:
- config: Release
rule: install

steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: |
brew install zlib libjpeg sdl2
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install

- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build .

- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --install .

- name: Update readme
working-directory: ${{runner.workspace}}/jaMME/build/mme
shell: bash
run: |
sed -i.bak "s/Date: .*..*..*/Date: $(date +"%d.%m.%Y")/" readme.txt
sed -i.bak "s/Revision: .*/Revision: "$(git rev-parse --short HEAD)"/" readme.txt
rm readme.txt.bak
- name: Create binary archive
working-directory: ${{runner.workspace}}/jaMME/build
shell: bash
run: |
chmod +x jamme.app/Contents/MacOS/jamme
chmod +x start_jaMME.command
rm start_jaMME.cmd
rm start_jaMME.sh
tar -cvf jamme-macos-${{ matrix.arch }}.tar ./*
- uses: actions/upload-artifact@v4
if: matrix.cc == 'clang' && matrix.config == 'Release'
with:
name: jamme-macos-${{ matrix.arch }}
path: ${{runner.workspace}}/jaMME/build/jamme-macos-${{ matrix.arch }}.tar
if-no-files-found: error

create-release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [windows, ubuntu, macos]
needs: [windows, ubuntu, macos, macos-arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -233,6 +294,7 @@ jobs:
7z a -r jamme-linux-x86_64.zip ./jamme-linux-x86_64/*
7z a -r jamme-windows-x86.zip ./jamme-windows-x86/*
7z a -r jamme-macos-x86_64.zip ./jamme-macos-x86_64/*
7z a -r jamme-macos-arm64.zip ./jamme-macos-arm64/*
- name: Create latest build
uses: crowbarmaster/GH-Automatic-Releases@latest
Expand Down

0 comments on commit 56014f0

Please sign in to comment.