-
Notifications
You must be signed in to change notification settings - Fork 108
193 lines (161 loc) · 5.54 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Build/Release
on: [push, workflow_dispatch]
jobs:
MacOS:
runs-on: macos-latest
steps:
- name: Check out Git repository
uses: actions/checkout@master
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@master
with:
node-version: 16
- name: Prepare for private keys
run: |
mkdir -p ~/private_keys/
- name: Prepare for app notarization
# Import Apple API key for app notarization on macOS
run: |
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Install Dependencies
run: yarn
- name: Build Electron app
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: yarn build
env:
# macOS Signing
CSC_LINK: ${{ secrets.mac_certs }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
# macOS notarization API key
APPLE_ID: ${{ secrets.apple_id }}
APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
ARCH: universal
- name: Release Electron app
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: yarn release
env:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
GH_TOKEN: ${{ secrets.github_token }}
# macOS Signing
CSC_LINK: ${{ secrets.mac_certs }}
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
# macOS notarization API key
APPLE_ID: ${{ secrets.apple_id }}
APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.apple_id_password }}
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
ARCH: universal
- name: .dmg artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: dmg file
path: |
dist/*.dmg
Windows:
runs-on: windows-latest
steps:
- name: Check out Git repository
uses: actions/checkout@master
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@master
with:
node-version: 16
- name: Create Windows certificate file
# Import certificate from secret store
run: |
echo "$windows_certs" > cert.p7b
shell: bash
env:
windows_certs: ${{ secrets.windows_certs }}
- name: Download jsign
run: |
curl -L -o jsign.jar https://github.com/ebourg/jsign/releases/download/6.0/jsign-6.0.jar
shell: bash
- name: Install Dependencies
run: yarn
- name: Build Electron app
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: yarn build
env:
CERT_PATH: cert.p7b
AWS_REGION: ${{ secrets.aws_region }}
AWS_ACCESS_KEY: ${{ secrets.aws_access_key }}
AWS_SECRET_KEY: ${{ secrets.aws_secret_key }}
KMS_ARN: ${{ secrets.kms_arn }}
ARCH: x64
- name: Release Electron app
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: yarn release
env:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
GH_TOKEN: ${{ secrets.github_token }}
CERT_PATH: cert.p7b
AWS_REGION: ${{ secrets.aws_region }}
AWS_ACCESS_KEY: ${{ secrets.aws_access_key }}
AWS_SECRET_KEY: ${{ secrets.aws_secret_key }}
KMS_ARN: ${{ secrets.kms_arn }}
ARCH: x64
- name: .exe artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: exe file
path: |
dist/*.exe
- name: .msi artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: msi file
path: |
dist/*.msi
Linux:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@master
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@master
with:
node-version: 16
- name: Install Dependencies
run: yarn
- name: Build Electron app
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: yarn build
env:
ARCH: x64
- name: Release Electron app
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: yarn release
env:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
GH_TOKEN: ${{ secrets.github_token }}
ARCH: x64
- name: .deb artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: deb file
path: |
dist/*.deb
- name: .rpm artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: rpm file
path: |
dist/*.rpm
- name: .AppImage artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
name: AppImage file
path: |
dist/*.AppImage