-
-
Notifications
You must be signed in to change notification settings - Fork 67
297 lines (246 loc) · 13.8 KB
/
electron_beta.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
name: Beta Testing and Build
on:
push:
tags: [beta-electron*]
jobs:
mac_x86_develop:
runs-on: macos-latest
defaults:
run:
shell: bash
strategy:
matrix:
node-versions: ["18.16.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set env
run: |
brew install jq
VERSION=$(cat package.json | jq .version)
export VERSION=$(echo ${VERSION:1:${#VERSION}-2})
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
- name: "Import Certificates"
run: |
echo -n ${{ secrets.SIGNING_CERTIFICATE_P12_DATA }} | base64 --decode --output certificate.p12
export KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain
security create-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} $KEYCHAIN_PATH
security import certificate.p12 -P ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }} -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${{ secrets.KEYCHAIN_PASSWORD }} $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: "Setup PNPM"
uses: pnpm/action-setup@v2
with:
version: 8
- name: "Install Node Module"
run: |
pnpm install
- name: "Build and Package"
run: pnpm run build-mac-x86-dev
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Oracle Cloud CLI
run: |
brew install oci-cli && mkdir ~/.oci
echo -n ${{ secrets.OCI_CFG_DATA }} | base64 --decode --output config
mv config ~/.oci
echo -n ${{ secrets.OCI_KEY_DATA }} | base64 --decode --output oraclekey.cer
mv oraclekey.cer ~/.oci
- name: Upload to Oracle Storage
run: |
oci os object bulk-delete --bucket-name ${{ secrets.OCI_OS_BUCKET }} --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --prefix distribution/dev_channel/
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.zip' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/Paperlib Beta_${{ env.VERSION }}.zip'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.zip.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/Paperlib Beta_${{ env.VERSION }}.zip.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/Paperlib Beta_${{ env.VERSION }}.dmg'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/latest.dmg'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/Paperlib Beta_${{ env.VERSION }}.dmg.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/beta-mac.yml' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/dev_channel/beta-mac.yml'
mac_arm_develop:
runs-on: self-hosted
defaults:
run:
shell: bash
strategy:
matrix:
node-versions: ["18.16.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
brew install jq
VERSION=$(cat package.json | jq .version)
export VERSION=$(echo ${VERSION:1:${#VERSION}-2})
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: "Setup PNPM"
uses: pnpm/action-setup@v2
with:
version: 8
- name: "Install Node Module"
run: |
pnpm install
- name: "Build and Package"
run: |
pnpm run build-mac-arm-dev
cp ./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}.dmg ./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}_arm.dmg
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}_arm.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Oracle Cloud CLI
run: |
brew install oci-cli && mkdir -p ~/.oci
echo -n ${{ secrets.OCI_CFG_DATA }} | base64 --decode -o config
mv config ~/.oci
echo -n ${{ secrets.OCI_KEY_DATA }} | base64 --decode -o oraclekey.cer
mv oraclekey.cer ~/.oci
- name: Upload to Oracle Storage
run: |
oci os object bulk-delete --bucket-name ${{ secrets.OCI_OS_BUCKET }} --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --prefix distribution/arm_dev_channel/
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.zip' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/Paperlib Beta_${{ env.VERSION }}.zip'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.zip.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/Paperlib Beta_${{ env.VERSION }}.zip.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/Paperlib Beta_${{ env.VERSION }}.dmg'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/latest.dmg'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.dmg.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/Paperlib Beta_${{ env.VERSION }}.dmg.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/beta-mac.yml' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/arm_dev_channel/beta-mac.yml'
- name: Clean Up
run: |
rm -rf ./*
win_develop:
runs-on: windows-latest
defaults:
run:
shell: bash
strategy:
matrix:
node-versions: ["18.16.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
curl -L -o /usr/bin/jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe
VERSION=$(cat package.json | jq .version)
export VERSION=$(echo ${VERSION:1:${#VERSION}-2})
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: "Setup PNPM"
uses: pnpm/action-setup@v2
with:
version: 8
- name: "Install Node Module"
run: |
pnpm install
- name: "Build and Package"
run: pnpm run build-win-dev
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Oracle Cloud CLI
run: |
pip install cffi
curl https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1 --output install.ps1
powershell ./install.ps1 -AcceptAllDefaults
mkdir ~/.oci
echo ${{ secrets.OCI_CFG_DATA }} > config.secret
base64 --decode config.secret > config
mv config ~/.oci
echo ${{ secrets.OCI_KEY_DATA }} > oraclekey.cer.secret
base64 --decode oraclekey.cer.secret > oraclekey.cer
mv oraclekey.cer ~/.oci
- name: Upload to Oracle Storage
run: |
powershell "Compress-Archive -Path '.\release\${{ env.VERSION }}\Paperlib Beta_${{ env.VERSION }}.exe' -DestinationPath '.\latest.zip'"
oci os object bulk-delete --bucket-name ${{ secrets.OCI_OS_BUCKET }} --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --prefix distribution/win_dev_channel/
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './latest.zip' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/win_dev_channel/latest.zip'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.exe' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/win_dev_channel/Paperlib Beta_${{ env.VERSION }}.exe'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.exe.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/win_dev_channel/Paperlib Beta_${{ env.VERSION }}.exe.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.exe' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/win_dev_channel/latest.exe'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/beta.yml' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/win_dev_channel/beta.yml'
linux_develop:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
node-versions: ["18.16.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
sudo apt install -y jq
VERSION=$(cat package.json | jq .version)
export VERSION=$(echo ${VERSION:1:${#VERSION}-2})
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: "Setup PNPM"
uses: pnpm/action-setup@v2
with:
version: 8
- name: "Install Node Module"
run: |
pnpm install
- name: "Build and Package"
run: pnpm run build-linux-dev
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib\ Beta_${{ env.VERSION }}.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Oracle Cloud CLI
run: |
curl -L -O https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh
bash ./install.sh --accept-all-defaults
mkdir ~/.oci
echo -n ${{ secrets.OCI_CFG_DATA }} | base64 --decode > config
mv config ~/.oci
echo -n ${{ secrets.OCI_KEY_DATA }} | base64 --decode > oraclekey.cer
mv oraclekey.cer ~/.oci
- name: Upload to Oracle Storage
run: |
~/bin/oci os object bulk-delete --bucket-name ${{ secrets.OCI_OS_BUCKET }} --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --prefix distribution/linux_dev_channel/
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.AppImage' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/linux_dev_channel/Paperlib Beta_${{ env.VERSION }}.AppImage'
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib Beta_${{ env.VERSION }}.AppImage' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/linux_dev_channel/latest.AppImage'
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/beta-linux.yml' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/linux_dev_channel/beta-linux.yml'