Skip to content

Commit

Permalink
Add M1 builds to CI workflow (Currently w/out Crashpad enabled!)
Browse files Browse the repository at this point in the history
Have the CI automatically create M1 mac builds.
TODO: Crashpad doesn't seem to want to work with ARM macs,
 figure out how to fix this later.
  • Loading branch information
bluebandit21 committed Mar 11, 2024
1 parent 9ec41de commit a692102
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,101 @@ jobs:
with:
files: ${{github.workspace}}/main/build/*.tar.gz

macos_aarch64:
name: macOS aarch64 ${{matrix.cfg.name}}
runs-on: ${{matrix.cfg.os}}
strategy:
fail-fast: false
matrix:
cfg:
- { os: macos-14, name: "Sonoma", dist: true }

steps:

- name: Checkout Etterna
uses: actions/checkout@v3
with:
path: main

- name: Checkout CrashpadTools
uses: actions/checkout@v3
with:
repository: etternagame/CrashpadTools
path: tools

- name: Install homebrew packages
run: brew install cmake nasm ninja openssl

- name: Setup Python 2.7
uses: MatteoH2O1999/[email protected]
with:
python-version: '2.7'

- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Generate CMake
run: mkdir main/build && cd main/build && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja ..

- name: Build Project
run: cd main/build && ninja

- name: Generate binary
if: ${{matrix.cfg.dist}}
run: cd main/build && cpack

- name: Upload Binary
if: ${{matrix.cfg.dist}}
uses: actions/upload-artifact@v3
with:
name: "Etterna - macOS aarch64"
path: '${{github.workspace}}/main/build/*.dmg'

- name: Update Environment Variables
if: ${{matrix.cfg.dist}}
run: |
echo "${{github.workspace}}/tools/mac" >> $GITHUB_PATH
echo "ETTERNA_ARCH=aarch64" >> $GITHUB_ENV
- name: Generate Symbols
if: ${{matrix.cfg.dist}}
run: |
echo "Running dsymutil..."
dsymutil -o ${{github.workspace}}/main/Etterna.dsym main/Etterna.app/Contents/MacOS/Etterna > /dev/null
echo "Dumping Symbols..."
dump_syms ${{github.workspace}}/main/Etterna.dsym main/Etterna.app/Contents/MacOS/Etterna > ${{github.workspace}}/main/Etterna.sym
echo "Stripping debug symbols from binary..."
strip main/Etterna.app/Contents/MacOS/Etterna
- name: Prepare symbols for upload artifacts
if: ${{matrix.cfg.dist}}
run: cd main && ${{github.workspace}}/main/.ci/prepare_symbols.py

- name: Upload Symbols to action artifacts
if: ${{matrix.cfg.dist}}
uses: actions/upload-artifact@v3
with:
name: Etterna Symbols - ${{github.sha}}
path: '${{github.workspace}}/main/EtternaSymbolsUploadDir'

- name: Get version for CrashServer Upload
id: get_version
if: ${{ matrix.cfg.dist && github.event_name == 'release' && github.event.action == 'published' }}
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Upload Symbols to Crash Server
if: ${{ matrix.cfg.dist && github.event_name == 'release' && github.event.action == 'published' }}
run: symupload ${{github.workspace}}/main/Etterna.sym "https://crash.etterna.dev/api/symbol/upload?api_key=${{secrets.CRASHSERVER_API_KEY}}&version=${{ steps.get_version.outputs.VERSION }}"

- name: Upload files to Release
uses: softprops/action-gh-release@v1
if: ${{ matrix.cfg.dist && github.event_name == 'release' && github.event.action == 'published' }}
with:
files: ${{github.workspace}}/main/build/*.dmg

macos:
name: macOS x64 ${{matrix.cfg.name}}
runs-on: ${{matrix.cfg.os}}
Expand Down

0 comments on commit a692102

Please sign in to comment.