Skip to content

Commit

Permalink
ci: Add build for arm64 macOS, and add to release
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Aug 7, 2024
1 parent a4d3c5f commit ffa2b21
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ jobs:
- run: '& "C:\Program Files (x86)\System76\Keyboard Configurator\system76-keyboard-configurator.exe" --help-gtk'

macos:
# TODO: `macos-14` runner uses Apple Silicon
runs-on: macos-13
steps:
- run: brew install gtk+3 imagemagick librsvg adwaita-icon-theme
Expand Down Expand Up @@ -108,10 +107,44 @@ jobs:
- run: '"./mnt/System76 Keyboard Configurator.app/Contents/MacOS/keyboard-configurator" --help-gtk'
- run: 'open "mnt/System76 Keyboard Configurator.app" --args --help-gtk'

# `macos-14` runner uses Apple Silicon
macos-arm64:
runs-on: macos-14
steps:
- run: brew install gtk+3 imagemagick librsvg adwaita-icon-theme
- run: npm install -g appdmg
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
- env:
AC_PASSWORD: ${{ github.event_name == 'release' && secrets.AC_PASSWORD || '' }}
AC_USERNAME: ${{ github.event_name == 'release' && secrets.AC_USERNAME || '' }}
MACOS_CERTIFICATE: ${{ github.event_name == 'release' && secrets.MACOS_CERTIFICATE || '' }}
MACOS_SCRIPT: ${{ github.event_name == 'release' && 'bash ./signing.sh' || 'python3 ./build.py' }}
run: cd macos && $MACOS_SCRIPT $RELEASE
- run: mv macos/keyboard-configurator.dmg macos/keyboard-configurator-arm64.dmg
- uses: actions/upload-artifact@v2
with:
if-no-files-found: error
name: keyboard-configurator-macos-arm64-${{ github.sha }}
path: macos/keyboard-configurator-arm64.dmg

macos-arm64-test:
runs-on: macos-14
needs: macos-arm64
steps:
- uses: actions/download-artifact@v2
with:
name: keyboard-configurator-macos-arm64-${{ github.sha }}
- run: mkdir mnt && hdiutil attach keyboard-configurator-arm64.dmg -mountpoint $PWD/mnt
- run: '"./mnt/System76 Keyboard Configurator.app/Contents/MacOS/keyboard-configurator" --help-gtk'
- run: 'open "mnt/System76 Keyboard Configurator.app" --args --help-gtk'



upload-to-release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [linux-x86_64, windows-mingw32, macos]
needs: [linux-x86_64, windows-mingw32, macos, macos-arm64]
steps:
- uses: actions/checkout@v2
- run: echo VERSION=$(./.github/workflows/version.py) > $GITHUB_ENV
Expand Down Expand Up @@ -140,3 +173,11 @@ jobs:
asset_path: keyboard-configurator-macos-${{ github.sha }}/keyboard-configurator.dmg
asset_name: keyboard-configurator-${{ env.VERSION }}.dmg
asset_content_type: application/x-apple-diskimage
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-macos-arm64-${{ github.sha }}/keyboard-configurator-arm64.dmg
asset_name: keyboard-configurator-arm64-${{ env.VERSION }}.dmg
asset_content_type: application/x-apple-diskimage

0 comments on commit ffa2b21

Please sign in to comment.