-
-
Notifications
You must be signed in to change notification settings - Fork 14
101 lines (98 loc) · 2.99 KB
/
deploy.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build/release
on:
push:
branches:
- main
- alpha
- beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Archive other artifacts
uses: actions/upload-artifact@v4
with:
name: desktop
path: desktop
- name: Archive package.json
uses: actions/upload-artifact@v4
with:
name: package
path: package.json
release:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{env.GITHUB_REF}}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Download production artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Download other artifacts
uses: actions/download-artifact@v4
with:
name: desktop
path: desktop
- name: Remove old package.json
run: rm package.json
- name: Download package
uses: actions/download-artifact@v4
with:
name: package
path: "."
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
if: always()
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.GITHUB_TOKEN }}
mac_certs: ${{ secrets.MAC_CERTS }}
mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }}
# Don't worry about running the build, just use electron-builder
skip_build: true
# If the commit is tagged with a version (e.g. "1.0.0"),
# release the app after building
release: true
env:
# macOS notarization
APPLE_API_KEY_ID: ${{ secrets.API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.API_KEY_ISSUER_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2
if: failure()