Build, Sign, and Notarize macOS App #5
Workflow file for this run
This file contains 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: Build, Sign, and Notarize macOS App | |
on: | |
release: | |
types: [prereleased] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.16.0' | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Import Code-Signing Certificates | |
uses: Apple-Actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} | |
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
- name: Build application | |
env: | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
run: pnpm run build:desktop | |
- name: Build and Sign | |
env: | |
APPLEID: ${{ secrets.APPLE_ID }} | |
APPLEIDPASS: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
APPLETEAMID: ${{ secrets.APPLE_TEAM_ID }} | |
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }} | |
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
run: pnpm run pkg:desktop | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-app | |
path: dist-app/*.dmg | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist-app/*.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |