170 lines (166 loc) · 6.14 KB
/
build-electron.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
name: Build Electron
on:
workflow_dispatch:
inputs:
environment:
type: environment
default: "Local"
targets:
type: choice
description: "Targets to build"
default: "All"
required: true
options:
- "All"
- "Linux"
- "macOS"
- "Windows"
push:
branches:
- "v4"
- "master"
- "feature/**"
- "fix/**"
paths:
- "packages/electron/**"
- "assets/**"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
linux:
if: ${{ !github.event.inputs.targets || github.event.inputs.targets == 'All' || github.event.inputs.targets == 'Linux' }}
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || 'Local' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
~/.npm
~/.nvm
node_modules
packages/electron/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: |
npm i -g npm@8.2.0
npm ci
- name: Build
run: |
npm run electron:build
env:
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
- name: Archive AppImage
uses: actions/upload-artifact@v2
with:
name: padloc-linux-${{ github.sha }}-unsigned.AppImage
path: packages/electron/dist/*.AppImage
if-no-files-found: error
- name: Archive Unpacked
uses: actions/upload-artifact@v2
with:
name: padloc-linux-${{ github.sha }}-unpacked
path: packages/electron/dist/linux-unpacked
if-no-files-found: error
macos_unsigned:
if: ${{ !github.event.inputs.targets || github.event.inputs.targets == 'All' || github.event.inputs.targets == 'macOS' }}
runs-on: macos-11
environment: ${{ github.event.inputs.environment || 'Local' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
~/.npm
~/.nvm
node_modules
packages/electron/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: |
npm i -g npm@8.2.0
npm ci
- name: Build
run: |
npm run electron:build
env:
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Archive dmg
uses: actions/upload-artifact@v2
with:
name: padloc-macos-${{ github.sha }}-unsigned.dmg
path: packages/electron/dist/*.dmg
if-no-files-found: error
macos_signed:
if: ${{ !github.event.inputs.targets || github.event.inputs.targets == 'All' || github.event.inputs.targets == 'macOS' }}
runs-on: macos-11
environment: ${{ github.event.inputs.environment || 'Local' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
~/.npm
~/.nvm
node_modules
packages/electron/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: |
npm i -g npm@8.2.0
npm ci
- name: Build
run: |
npm run electron:build
env:
CSC_LINK: ${{ secrets.PL_MACOS_SIGNING_CERT_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.PL_MACOS_SIGNING_CERT_PASSWORD }}
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
- name: Archive dmg
uses: actions/upload-artifact@v2
with:
name: padloc-macos-${{ github.sha }}-signed.dmg
path: packages/electron/dist/*.dmg
if-no-files-found: error
windows:
if: ${{ !github.event.inputs.targets || github.event.inputs.targets == 'All' || github.event.inputs.targets == 'Windows' }}
runs-on: windows-2019
environment: ${{ github.event.inputs.environment || 'Local' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
- uses: actions/cache@v2
with:
path: |
~/.npm
~/.nvm
node_modules
packages/electron/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: |
npm i -g npm@8.2.0
npm ci
- name: Build
run: |
npm run electron:build
env:
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
- name: Archive exe
uses: actions/upload-artifact@v2
with:
name: padloc-windows-${{ github.sha }}-unsigned.exe
path: packages/electron/dist/*.exe
if-no-files-found: error