-
Notifications
You must be signed in to change notification settings - Fork 1
327 lines (318 loc) · 15.7 KB
/
release.yaml
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
name: release-kchat
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
begin-notification:
runs-on: ubuntu-latest
steps:
- name: release/checkout-repo
uses: actions/checkout@v3
- name: release/notify-channel
run: |
jq --null-input \
--arg icon_url "https://infomaniak.kchat.infomaniak.com/static/emoji/kchat.png" \
--arg username "DesktopReleaseBot" \
--arg text "[$GITHUB_REF_NAME] Release for desktop app started from GitHub, it should take about 30 minutes to complete." \
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json ${{ secrets.RELEASE_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
create-release:
runs-on: ubuntu-latest
permissions: write-all
outputs:
output_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: release/checkout-repo
uses: actions/checkout@v3
- name: Set Prerelease Flag
id: prerelease_check
run: |
if [[ "${{ github.ref }}" == *"-beta"* ]] || [[ "${{ github.ref }}" == *"-alpha"* ]]; then
echo "PRERELEASE=true" >> $GITHUB_ENV
else
echo "PRERELEASE=false" >> $GITHUB_ENV
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: ${{ env.PRERELEASE }}
# build-mac:
# runs-on: macos-12
# env:
# MAC_PROFILE: ${{ secrets.MAC_PROVISION_PROFILE }}
# APPLE_ID: ${{ secrets.APPLEID }}
# APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASS }}
# APPLE_TEAM_ID: ${{ secrets.APPLETEAMID }}
# CSC_FOR_PULL_REQUEST: true
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# CSC_LINK: ${{ secrets.CSC_LINK }}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_RELEASE: ${{ github.ref_name }}
# needs:
# - create-release
# steps:
# - name: release/checkout-repo
# uses: actions/checkout@v3
# - name: release/setup-node
# uses: actions/setup-node@v3
# with:
# node-version-file: "package.json"
# cache: "npm"
# cache-dependency-path: package-lock.json
# - name: release/install-dependencies
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# brew install yq rename
# sudo -H pip install setuptools
# npm ci
# - name: release/copy-provisioning-profile
# run: echo $MAC_PROFILE | base64 -D > ./mac.provisionprofile
# - name: release/update-version
# uses: ./.github/actions/version
# # - name: release/test
# # uses: ./.github/actions/test
# - name: release/build
# run: |
# npm run package:mac
# mkdir -p ./artifacts
# find ./release -type f \( -name "*.dmg" \) -exec cp {} ./artifacts/ \;
# - name: release/upload-build
# uses: actions/upload-artifact@v3
# with:
# name: artifacts
# path: ./artifacts
# retention-days: 1
# build-linux:
# runs-on: ubuntu-latest
# needs:
# - create-release
# steps:
# - name: release/checkout-repo
# uses: actions/checkout@v3
# - name: release/setup-node
# uses: actions/setup-node@v3
# with:
# node-version-file: "package.json"
# cache: "npm"
# cache-dependency-path: package-lock.json
# - name: release/install-dependencies
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_22.04/Release.key | sudo apt-key add -
# wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
# sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata
# npm ci
# - name: release/update-version
# uses: ./.github/actions/version
# # - name: release/test
# # uses: ./.github/actions/test
# - name: release/build
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_RELEASE: ${{ github.ref_name }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# run: |
# mkdir -p ./build/linux
# npm run package:linux
# mkdir -p ./artifacts
# find ./release -type f \( -name "*.rpm" -o -name "*.deb" -o -name "*.AppImage" \) -exec cp {} ./artifacts/ \;
# - name: release/upload-build
# uses: actions/upload-artifact@v3
# with:
# name: artifacts
# path: ./artifacts
# retention-days: 1
build-msi-installer:
runs-on: windows-2022
needs:
- create-release
steps:
- name: release/checkout-repo
uses: actions/checkout@v3
- name: release/setup-node
uses: actions/setup-node@v3
with:
node-version: "18.15.0"
- name: release/optimize
shell: powershell
run: ./scripts/Makefile.ps1 optimize
- name: release/install-deps
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: powershell
run: |
./scripts/Makefile.ps1 install-deps
choco install yq --version 4.15.1 -y
npm i -g node-gyp
node-gyp install
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32
npm ci --openssl_fips=''
- name: release/update-version
uses: ./.github/actions/version
# - name: release/test
# uses: ./.github/actions/test
- name: release/build
shell: powershell
env:
MM_WIN_INSTALLERS: 1
PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }}
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }}
PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }}
CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ github.ref_name }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_FILE_B64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
SM_HOST: ${{ secrets.SM_HOST }}
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
SM_KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
SM_TOOLS_URI: ${{ secrets.SM_TOOLS_URI }}
SM_CLIENT_CERT_FILE: ${{ secrets.SM_CLIENT_CERT_FILE }}
run: |
./scripts/setup-keylocker.ps1
./scripts/Makefile.ps1 build
- name: nightly/package
run: |
mkdir -p ./artifacts
bash -x ./scripts/cp_artifacts.sh release ./artifacts
- name: release/upload-build
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./artifacts
retention-days: 1
upload-to-github:
runs-on: ubuntu-latest
needs:
- create-release
# - build-mac
- build-msi-installer
# - build-linux
steps:
- name: release/download-builds
uses: actions/download-artifact@v3
with:
name: artifacts
path: ./artifacts
- name: upload artifact mac arm64
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-mac-arm64.dmg"
asset_name: "kchat-desktop-${{ github.ref_name }}-mac-arm64.dmg"
asset_content_type: application/octet-stream
- name: upload artifact mac x64
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-mac-x64.dmg"
asset_name: "kchat-desktop-${{ github.ref_name }}-mac-x64.dmg"
asset_content_type: application/octet-stream
- name: upload artifact win exe
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-setup-${{ github.ref_name }}-win.exe"
asset_name: "kchat-desktop-setup-${{ github.ref_name }}-win.exe"
asset_content_type: application/octet-stream
- name: upload artifact win msi x64
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-x64.msi"
asset_name: "kchat-desktop-${{ github.ref_name }}-x64.msi"
asset_content_type: application/octet-stream
- name: upload artifact win msi x86
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-x86.msi"
asset_name: "kchat-desktop-${{ github.ref_name }}-x86.msi"
asset_content_type: application/octet-stream
- name: upload artifact linux x86_64 AppImage
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-linux-x86_64.AppImage"
asset_name: "kchat-desktop-${{ github.ref_name }}-linux-x86_64.AppImage"
asset_content_type: application/octet-stream
- name: upload artifact linux arm64 AppImage
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-linux-arm64.AppImage"
asset_name: "kchat-desktop-${{ github.ref_name }}-linux-arm64.AppImage"
asset_content_type: application/octet-stream
- name: upload artifact linux x86_64 rpm
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-linux-x86_64.rpm"
asset_name: "kchat-desktop-${{ github.ref_name }}-linux-x86_64.rpm"
asset_content_type: application/octet-stream
- name: upload artifact linux aarch64 rpm
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop-${{ github.ref_name }}-linux-aarch64.rpm"
asset_name: "kchat-desktop-${{ github.ref_name }}-linux-aarch64.rpm"
asset_content_type: application/octet-stream
- name: upload artifact linux amd64 deb
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop_${{ github.ref_name }}-1_amd64.deb"
asset_name: "kchat-desktop_${{ github.ref_name }}-1_amd64.deb"
asset_content_type: application/octet-stream
- name: upload artifact linux arm64 deb
continue-on-error: true
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.create-release.outputs.output_url }}
asset_path: "./artifacts/kchat-desktop_${{ github.ref_name }}-1_arm64.deb"
asset_name: "kchat-desktop_${{ github.ref_name }}-1_arm64.deb"
asset_content_type: application/octet-stream
end-notification:
runs-on: ubuntu-latest
needs:
- upload-to-github
steps:
- name: release/checkout-repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: release/notify-channel
run: |
jq --null-input \
--arg icon_url "https://infomaniak.kchat.infomaniak.com/static/emoji/kchat.png" \
--arg username "DesktopReleaseBot" \
--arg text "$(bash -x scripts/generate_release_post.sh $GITHUB_REF_NAME)" \
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json ${{ secrets.RELEASE_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"