name: electron-macos-arm64 on: push: branches: [ main ] tags: [ 'v*' ] pull_request: branches: [ main ] workflow_dispatch: jobs: electron-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" - name: Verify toolchain run: | set -euo pipefail node --version npm --version xcode-select -p - name: Install npm dependencies run: | set -euo pipefail npm ci - name: Build macOS arm64 zip run: | set -euo pipefail npx electron-builder --mac zip --arm64 --publish never - name: Pack artifact and copy to Desktop run: | set -euo pipefail rm -rf artifacts mkdir -p artifacts "$HOME/Desktop" zip_path="$(find dist -maxdepth 1 -type f -name '*.zip' | head -n1 || true)" [ -n "$zip_path" ] || { echo 'No macOS zip produced'; exit 1; } out="electron_tray_demo-macos-arm64-run${{ github.run_number }}.zip" cp "$zip_path" "artifacts/$out" cp "artifacts/$out" "$HOME/Desktop/$out" - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: electron_tray_demo-macos-arm64-run${{ github.run_number }} path: artifacts/ retention-days: 14