mac build default target #97
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 Electron App | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
npm install --include=dev | |
cd frontend | |
npm install --include=dev | |
- name: Clean build directories | |
run: | | |
rm -rf dist | |
cd frontend | |
rm -rf dist | |
- name: Build frontend with Vite | |
run: | | |
cd frontend | |
npx vite build | |
- name: Prepare for code signing | |
run: | | |
mkdir -p ~/private_keys/ | |
echo "${{ secrets.MAC_CERTS }}" | base64 --decode > ~/private_keys/certs.p12 | |
echo "${{ secrets.NOTA_CERT }}" | base64 --decode > ~/private_keys/notarize.p8 | |
security create-keychain -p "" build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
security import ~/private_keys/certs.p12 -k build.keychain -P "${{ secrets.MAC_CERTS_PASSWORD }}" -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain | |
- name: Build/release Electron app (macOS) | |
uses: samuelmeuli/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
args: --mac --x64 --arm64 | |
env: | |
CSC_LINK: file:///Users/runner/private_keys/certs.p12 | |
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }} | |
API_KEY_ID: ${{ vars.API_KEY_ID }} | |
API_KEY_ISSUER_ID: ${{ vars.API_KEY_ISSUER_ID }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
build-non-macos: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
npm install --include=dev | |
cd frontend | |
npm install --include=dev | |
- name: Build frontend with Vite | |
run: | | |
cd frontend | |
npx vite build | |
- name: Build/release Electron app (non-macOS) | |
uses: samuelmeuli/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |