-
-
Notifications
You must be signed in to change notification settings - Fork 68
305 lines (254 loc) · 14.6 KB
/
electron_release.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
298
299
300
301
302
303
304
305
name: Build and Release (electron)
on:
push:
tags: [release-electron*]
permissions:
contents: write
jobs:
mac_x86_deploy:
runs-on: macos-latest
strategy:
matrix:
node-versions: ["16.17.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
release_version=${GITHUB_REF#refs/*/}
export VERSION=${release_version:17}
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
cp ./build_configs/electron-builder.mac.json5 ./electron-builder.json5
rm -rf ./app/utils/crypto
- 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 list-keychain -d user -s $KEYCHAIN_PATH
- name: "Clone Private Repository"
uses: actions/checkout@v2
with:
repository: Future-Scholars/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-versions }}
- name: "Install Node Module"
run: npm install --force
- name: "Build and Package"
run: npm run build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Convert Change Log to HTML
run: |
brew install pandoc
pandoc -f markdown -t html ./CHANGELOG_EN.md -o changelog_en.html
pandoc -f markdown -t html ./CHANGELOG_CN.md -o changelog_cn.html
- name: Install Oracle Cloud CLI
run: |
brew install oci-cli && mkdir ~/.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 put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./changelog_en.html --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/changelog_en.html
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./changelog_cn.html --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/changelog_cn.html
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.zip --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/Paperlib_${{ env.VERSION }}.zip
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.zip.blockmap --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/Paperlib_${{ env.VERSION }}.zip.blockmap
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/Paperlib_${{ env.VERSION }}.dmg
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/latest.dmg
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg.blockmap --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/Paperlib_${{ env.VERSION }}.dmg.blockmap
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/latest-mac.yml --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac/latest-mac.yml
mac_arm_deploy:
runs-on: self-hosted
strategy:
matrix:
node-versions: ["16.17.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
release_version=${GITHUB_REF#refs/*/}
export VERSION=${release_version:17}
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
cp ./build_configs/electron-builder.mac.arm.json5 ./electron-builder.json5
rm -rf ./app/utils/crypto
- name: "Clone Private Repository"
uses: actions/checkout@v2
with:
repository: Future-Scholars/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-versions }}
- name: "Install Node Module"
run: npm install --force
- name: "Build and Package"
run: |
npm run build
cp ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}_arm.dmg
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}_arm.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Convert Change Log to HTML
run: |
brew install pandoc
pandoc -f markdown -t html ./CHANGELOG_EN.md -o changelog_en.html
pandoc -f markdown -t html ./CHANGELOG_CN.md -o changelog_cn.html
- 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 put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./changelog_en.html --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/changelog_en.html
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./changelog_cn.html --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/changelog_cn.html
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.zip --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/Paperlib_${{ env.VERSION }}.zip
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.zip.blockmap --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/Paperlib_${{ env.VERSION }}.zip.blockmap
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/Paperlib_${{ env.VERSION }}.dmg
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/latest.dmg
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.dmg.blockmap --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/Paperlib_${{ env.VERSION }}.dmg.blockmap
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/latest-mac.yml --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-mac-arm/latest-mac.yml
- name: Clean Up
run: |
rm -rf ./*
win_deploy:
runs-on: windows-latest
defaults:
run:
shell: bash
strategy:
matrix:
node-versions: ["16.17.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
release_version=${GITHUB_REF#refs/*/}
export VERSION=${release_version:17}
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
cp ./build_configs/electron-builder.win.json5 ./electron-builder.json5
rm -rf ./app/utils/crypto
- name: "Clone Private Repository"
uses: actions/checkout@v2
with:
repository: Future-Scholars/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-versions }}
- name: "Install Node Module"
run: npm install --force
- name: "Build and Package"
run: npm run build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./release/${{ env.VERSION }}/Paperlib_${{ 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 './release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.exe' './latest.zip'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './latest.zip' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/electron-win/latest.zip'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.exe' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/electron-win/Paperlib_${{ env.VERSION }}.exe'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.exe' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-win/latest.exe
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.exe.blockmap' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name 'distribution/electron-win/Paperlib_${{ env.VERSION }}.exe.blockmap'
oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file './release/${{ env.VERSION }}/latest.yml' --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-win/latest.yml
# - name: Publish to WinGet
# uses: vedantmgoyal2009/winget-releaser@v2
# with:
# identifier: FutureScholars.Paperlib
# version: ${{ env.VERSION }}
# token: ${{ secrets.WINGET_TOKEN }}
linux_develop:
runs-on: ubuntu-latest
strategy:
matrix:
node-versions: ["16.17.1"]
steps:
- name: "Checkout Project"
uses: actions/checkout@v2
- name: Set env
run: |
release_version=${GITHUB_REF#refs/*/}
export VERSION=${release_version:17}
export VERSION_SHORT=$(echo $VERSION | sed 's/\.//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_SHORT=$VERSION_SHORT" >> $GITHUB_ENV
cp ./build_configs/electron-builder.linux.json5 ./electron-builder.json5
rm -rf ./app/utils/crypto
- name: "Clone Private Repository"
uses: actions/checkout@v2
with:
repository: Future-Scholars/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto
- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: "Install Node Module"
run: npm install --force
- name: "Build and Package"
run: npm run build
- 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: |
cp ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.AppImage ./release/${{ env.VERSION }}/Paperlib_latest.AppImage
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_${{ env.VERSION }}.AppImage --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-linux/Paperlib_${{ env.VERSION }}.AppImage
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/Paperlib_latest.AppImage --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-linux/Paperlib_latest.AppImage
~/bin/oci os object put --bucket-name ${{ secrets.OCI_OS_BUCKET }} --file ./release/${{ env.VERSION }}/latest-linux.yml --namespace ${{ secrets.OCI_OS_NAMESPACE }} --force --name distribution/electron-linux/latest-linux.yml