macos ci: optional universal (x86_64 + arm64) build #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: macOS universal build | |
| on: | |
| push: | |
| branches: ['feature/apple-silicon-universal'] | |
| workflow_dispatch: | |
| env: | |
| MACOS_UNIVERSAL: 1 | |
| jobs: | |
| build: | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Install Go (pinned) | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install Qt 6.2.4 (pinned, official universal binaries) | |
| run: | | |
| pipx install aqtinstall | |
| aqt install-qt mac desktop 6.2.4 clang_64 -m qtwebsockets -O "$HOME/Qt" | |
| echo "QTDIR=$HOME/Qt/6.2.4/macos" >> "$GITHUB_ENV" | |
| - name: Build and package (universal) | |
| run: ./scripts/macos/build-local.sh --package --universal | |
| - name: Verify universal architecture | |
| run: | | |
| for bin in \ | |
| build/Moolticute.app/Contents/MacOS/moolticute \ | |
| build/Moolticute.app/Contents/MacOS/moolticuted \ | |
| build/Moolticute.app/Contents/MacOS/cli/mc-agent \ | |
| build/Moolticute.app/Contents/MacOS/cli/mc-cli | |
| do | |
| file "$bin" | |
| archs="$(lipo -archs "$bin" | tr ' ' '\n' | sort | tr '\n' ' ')" | |
| if [ "$archs" != "arm64 x86_64 " ]; then | |
| echo "ERROR: $bin is '$archs', expected both arm64 and x86_64" | |
| exit 1 | |
| fi | |
| done | |
| # Qt frameworks come from the universal Qt archives; spot-check one | |
| lipo -archs build/Moolticute.app/Contents/Frameworks/QtCore.framework/Versions/A/QtCore | |
| - name: Run tests | |
| working-directory: build | |
| run: ./tests/tests | |
| - name: Package DMG | |
| run: ./scripts/macos/package-release.sh | |
| - name: Upload universal artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Moolticute-macos-universal | |
| path: | | |
| build/Moolticute-*-macos-universal.dmg | |
| build/Moolticute-*-macos-universal.zip | |
| if-no-files-found: error |