name: Release # Push a tag like v0.4.2 (or run by hand) to build Pixie for macOS and publish a GitHub release. # Assets keep stable names so the website can link to # https://github.com///releases/latest/download/Pixie-macOS-universal.dmg on: push: tags: ["v*"] workflow_dispatch: inputs: tag: description: "Tag to release (e.g. v0.4.2). Created if missing." required: true permissions: contents: write jobs: macos: runs-on: macos-14 env: TAG: ${{ github.event.inputs.tag || github.ref_name }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 cache: npm - uses: dtolnay/rust-toolchain@stable with: targets: aarch64-apple-darwin,x86_64-apple-darwin - uses: Swatinem/rust-cache@v2 - run: npm ci # Optional: real Developer ID signing + notarization when these repo secrets exist # (APPLE_CERTIFICATE, APPLE_CERTIFICATE_PASSWORD, APPLE_SIGNING_IDENTITY, APPLE_ID, # APPLE_PASSWORD, APPLE_TEAM_ID). Without them the app is ad-hoc signed and users open it # once with right-click → Open. - name: Signing environment env: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} run: | for v in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID; do if [ -n "${!v}" ]; then { echo "$v<<__EOF__"; echo "${!v}"; echo "__EOF__"; } >> "$GITHUB_ENV" fi done [ -n "$APPLE_SIGNING_IDENTITY" ] && echo "Developer ID signing on" || echo "Ad-hoc signing" - name: Build universal app run: npm run app:build:universal - name: Package assets id: pkg run: | set -euo pipefail VERSION="${TAG#v}" BUNDLE=target/universal-apple-darwin/release/bundle mkdir -p dist-release cp "$BUNDLE"/dmg/*.dmg "dist-release/Pixie-macOS-universal.dmg" cp "dist-release/Pixie-macOS-universal.dmg" "dist-release/Pixie_${VERSION}_macOS_universal.dmg" ditto -c -k --keepParent "$BUNDLE/macos/Pixie.app" "dist-release/Pixie-macOS-universal.zip" (cd dist-release && shasum -a 256 *.dmg *.zip > SHA256SUMS.txt) # Release notes: this version's section of CHANGELOG.md. awk -v v="$VERSION" '$0 ~ "^## "v" " {f=1; next} /^## / && f {exit} f' CHANGELOG.md > notes.md || true printf '\n---\nDownload **Pixie-macOS-universal.dmg** (Apple Silicon and Intel, macOS 14+). If macOS says it can’t check the app, right-click Pixie in Applications → Open once.\n' >> notes.md ls -la dist-release - name: Publish release uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.TAG }} name: Pixie ${{ env.TAG }} body_path: notes.md files: | dist-release/Pixie-macOS-universal.dmg dist-release/Pixie-macOS-universal.zip dist-release/Pixie_*_macOS_universal.dmg dist-release/SHA256SUMS.txt