-
Notifications
You must be signed in to change notification settings - Fork 88
252 lines (207 loc) · 9.21 KB
/
desktop-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
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
name: Desktop release build
on:
release:
types:
[released, prereleased]
jobs:
run-e2e-tests-linux:
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-linux.yml
run-e2e-tests-mac:
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-mac.yml
run-e2e-tests-win:
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
uses: ./.github/workflows/e2e-win.yml
build-linux:
# needs: run-e2e-tests-linux
runs-on: ubuntu-22.04
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
S3_BUCKET: ${{ github.event.action == 'released' && 'quiet.2.x' || 'test.quiet' }}
CHECKSUM_PATH: ${{ github.event.action == 'released' && 'packages/desktop/dist/latest-linux.yml' || 'packages/desktop/dist/alpha-linux.yml' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Setup environment
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: Install libfuse
run: sudo apt install libfuse2
- name: Before build
uses: ./.github/actions/before-build
with:
source-path: linux
- name: "Set electron-builder props"
run: echo "ELECTRON_BUILDER_PROPS=-c.publish.bucket=$S3_BUCKET" >> $GITHUB_ENV
- name: "Release"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ARCH: x86_64
run: cd packages/desktop && USE_HARD_LINKS=false node_modules/.bin/electron-builder -p always --linux ${{ env.ELECTRON_BUILDER_PROPS }}
- name: "Calculate new checksum for electron updater"
run: lerna run postBuild --scope @quiet/desktop
- name: "Push electron-updater new checksum to S3"
uses: TryQuiet/upload-s3-action@c1c7c2268c91fbbc1293455e7b4bb2292267d2bd # master
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ env.S3_BUCKET }}
source_dir: ${{ env.CHECKSUM_PATH }}
destination_dir: ''
- name: Get release
id: get_release
uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f # v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Get release version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # main
with:
path: packages/desktop
- name: Upload Release Assets
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./packages/desktop/dist/Quiet-${{ steps.package-version.outputs.current-version}}.AppImage
asset_name: Quiet-${{ steps.package-version.outputs.current-version}}.AppImage
asset_content_type: application/.AppImage
build-macos:
# needs: run-e2e-tests-mac
runs-on: macos-13
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
S3_BUCKET: ${{ github.event.action == 'released' && 'quiet.2.x' || 'test.quiet' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- uses: actions-rs/components-nightly@254194ebf6ba07d2bb7cec8be76cee368d44fb90 # v1.1.1
with:
component: clippy
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
toolchain: nightly-2020-08-28
components: clippy
override: true
- name: Setup environment
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"
- name: Before build
uses: ./.github/actions/before-build
with:
source-path: darwin
- name: "Remove crud files"
run: xattr -cr .
- name: "Set electron-builder props"
run: echo "ELECTRON_BUILDER_PROPS=-c.publish.bucket=$S3_BUCKET" >> $GITHUB_ENV
- name: "Release"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
USE_HARD_LINKS: false
run: cd packages/desktop && node_modules/.bin/electron-builder -p always --mac ${{ env.ELECTRON_BUILDER_PROPS }}
- name: Get release
id: get_release
uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f # v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Extract version
id: extract_version
uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1
with:
path: packages/desktop
- name: Upload Release Assets
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./packages/desktop/dist/Quiet-${{ steps.extract_version.outputs.version}}.dmg
asset_name: Quiet-${{ steps.extract_version.outputs.version}}.dmg
asset_content_type: application/.dmg
build-windows:
# needs: run-e2e-tests-win
runs-on: windows-2019
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
env:
TEST_MODE: ${{ github.event.action == 'prereleased' }}
S3_BUCKET: ${{ github.event.action == 'released' && 'quiet.2.x' || 'test.quiet' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: "Fetch jsign"
shell: bash
run: cd packages/desktop && curl https://zbay-binaries.s3.us-east-2.amazonaws.com/jsign/jsign-2.1.jar --output ./jsign-2.1.jar
- name: "Add Windows certificate"
id: write_file
uses: TryQuiet/base64-to-file@64eeb40ad3514f57de3a7dee92aee10fd42452c1 # main
with:
fileName: 'win-certificate.pfx'
encodedString: ${{ secrets.WIN_CSC_LINK }}
- name: "Remove test files workaround (jest types conflicting with cypress types)"
run: find packages/desktop/src -name '*.test.*' -delete
shell: bash
- name: Setup environment
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle,e2e-tests"
- name: Before build
uses: ./.github/actions/before-build
with:
source-path: win32
- name: "Set electron-builder props"
shell: bash
run: echo "ELECTRON_BUILDER_PROPS=-c.publish.bucket=$S3_BUCKET" >> $GITHUB_ENV
- name: "Release"
shell: bash
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CERTIFICATE_PATH: ${{ steps.write_file.outputs.filePath }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
WINDOWS_ALIAS: ${{ secrets.WIN_ALIAS }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
USE_HARD_LINKS: false
run: cd packages/desktop && node_modules/.bin/electron-builder -p always --win ${{ env.ELECTRON_BUILDER_PROPS }}
- name: Get release
id: get_release
uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f # v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Extract version
id: extract_version
uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1
with:
path: packages/desktop
- name: Upload Release Assets
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./packages/desktop/dist/Quiet Setup ${{ steps.extract_version.outputs.version}}.exe
asset_name: Quiet Setup ${{ steps.extract_version.outputs.version}}.exe
asset_content_type: application/.exe