-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (42 loc) · 1.41 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Build Electron App
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, 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: Prepare for code signing
if: matrix.os == 'macos-latest'
run: |
mkdir -p ~/private_keys/
echo "${{ secrets.MAC_CERTS }}" | base64 --decode > ~/private_keys/certs.p12
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
uses: samuelmeuli/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
publish: always
env:
CSC_LINK: file:///Users/runner/private_keys/certs.p12
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }}