Add macOS arm64 Gitea workflow
This commit is contained in:
parent
8f570233a4
commit
19c8ed3b10
62
.gitea/workflows/qt-macos-arm64.yml
Normal file
62
.gitea/workflows/qt-macos-arm64.yml
Normal file
@ -0,0 +1,62 @@
|
||||
name: qt-macos-arm64
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags: [ 'v*' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
qt-macos-arm64:
|
||||
runs-on: macos-arm64
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Prepare PATH
|
||||
run: |
|
||||
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
|
||||
echo "/opt/homebrew/opt/qt/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Verify toolchain
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cmake --version | head -n1
|
||||
qmake --version | head -n2
|
||||
which macdeployqt
|
||||
xcode-select -p
|
||||
|
||||
- name: Configure + build app bundle
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf build-out artifacts
|
||||
cmake -S . -B build-out -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-out --parallel "$(sysctl -n hw.ncpu)"
|
||||
|
||||
- name: Deploy Qt app bundle
|
||||
run: |
|
||||
set -euo pipefail
|
||||
app_path="$(find build-out -maxdepth 2 -type d -name 'qt_tray_demo.app' | head -n1 || true)"
|
||||
[ -n "$app_path" ] || { echo 'No Qt .app bundle produced'; exit 1; }
|
||||
macdeployqt "$app_path"
|
||||
|
||||
- name: Pack artifact and copy to Desktop
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p artifacts "$HOME/Desktop"
|
||||
app_path="$(find build-out -maxdepth 2 -type d -name 'qt_tray_demo.app' | head -n1 || true)"
|
||||
[ -n "$app_path" ] || { echo 'No deployed Qt .app bundle found'; exit 1; }
|
||||
out="qt_tray_demo-macos-arm64-run${{ github.run_number }}.zip"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$app_path" "artifacts/$out"
|
||||
cp "artifacts/$out" "$HOME/Desktop/$out"
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: qt_tray_demo-macos-arm64-run${{ github.run_number }}
|
||||
path: artifacts/
|
||||
retention-days: 14
|
||||
Loading…
x
Reference in New Issue
Block a user