ci: reduce release workflow to MAS only #12
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish-mas: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: 'aarch64-apple-darwin,x86_64-apple-darwin' | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Import Mac App Distribution certificate | |
| uses: apple-actions/import-codesign-certs@v4 | |
| with: | |
| keychain: signing_temp_app | |
| create-keychain: true | |
| p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_MAS }} | |
| p12-password: ${{ secrets.APPLE_CERTIFICATE_MAS_PASSWORD }} | |
| - name: Import Mac Installer Distribution certificate | |
| uses: apple-actions/import-codesign-certs@v4 | |
| with: | |
| keychain: signing_temp_installer | |
| create-keychain: true | |
| p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_MAS_INSTALLER }} | |
| p12-password: ${{ secrets.APPLE_CERTIFICATE_MAS_INSTALLER_PASSWORD }} | |
| - name: Build Tauri (MAS .app) | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APPLE_SIGNING_IDENTITY: "3rd Party Mac Developer Application: Tan Zaichao (UWJL48X4C8)" | |
| APPLE_TEAM_ID: "UWJL48X4C8" | |
| with: | |
| args: '--target universal-apple-darwin --bundles app' | |
| - name: Build MAS installer .pkg | |
| env: | |
| INSTALLER_IDENTITY: "3rd Party Mac Developer Installer: Tan Zaichao (UWJL48X4C8)" | |
| run: | | |
| APP_PATH="src-tauri/target/universal-apple-darwin/release/bundle/macos/Light MD.app" | |
| PKG_PATH="src-tauri/target/universal-apple-darwin/release/bundle/macos/Light MD.pkg" | |
| mkdir -p "src-tauri/target/universal-apple-darwin/release/bundle/macos" | |
| productbuild --component "$APP_PATH" /Applications "$PKG_PATH" --sign "$INSTALLER_IDENTITY" | |
| - name: Write App Store Connect API key | |
| env: | |
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
| APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
| run: | | |
| mkdir -p ~/.private_keys | |
| echo "$APPLE_API_KEY" | base64 -d > ~/.private_keys/AuthKey_${APPLE_API_KEY_ID}.p8 | |
| - name: Upload to App Store Connect | |
| env: | |
| APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| run: | | |
| xcrun altool --upload-app \ | |
| --type macos \ | |
| --file "src-tauri/target/universal-apple-darwin/release/bundle/macos/Light MD.pkg" \ | |
| --apiKey "$APPLE_API_KEY_ID" \ | |
| --apiIssuer "$APPLE_API_ISSUER" |