-
Notifications
You must be signed in to change notification settings - Fork 2
263 lines (216 loc) · 7.04 KB
/
build-and-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
name: Build and Release bsky-desktop
on:
push:
branches: [$default-branch]
pull_request:
branches: [$default-branch]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: Build bsky-desktop (Linux)
runs-on: ubuntu-latest
env:
ext: "AppImage"
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build (armv7l)
run: npm run build -- --arch armv7l
- name: Build (x64)
run: npm run build -- --arch x64
- name: Build (arm64)
run: npm run build -- --arch arm64
- name: Download appimagelint and its deps
run: |
sudo apt update && sudo apt install fuse -y
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
chmod +x appimagelint-x86_64.AppImage
- name: Check the appimage(s)
run: ./appimagelint-x86_64.AppImage dist/*.AppImage
- name: Generate checksum
run: |
sha256sum dist/*.AppImage > dist/sha256sum.txt
sha256sum dist/*.deb >> dist/sha256sum.txt
sha256sum dist/*.zip >> dist/sha256sum.txt
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: linux-artifacts
path: |
dist/*.AppImage
dist/*.deb
dist/*.zip
dist/latest*.yml
dist/sha256sum.txt
build-windows:
name: Build bsky-desktop (Windows)
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build (ia32)
run: npm run build -- --arch ia32
- name: Build (x64)
run: npm run build -- --arch x64
- name: Build (arm64)
run: npm run build -- --arch arm64
- name: Generate checksum
run: |
sha256sum dist/*.exe > dist/sha256sum.txt
sha256sum dist/*.msi >> dist/sha256sum.txt
sha256sum dist/*.appx >> dist/sha256sum.txt
sha256sum dist/*.zip >> dist/sha256sum.txt
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: windows-artifacts
path: |
dist/*.exe
dist/*.msi
dist/*.appx
dist/*.zip
dist/latest*.yml
dist/sha256sum.txt
build-macos:
name: Build bsky-desktop (macOS)
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Setup node and npm
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Build (x64)
run: npm run build -- --arch x64
- name: Build (arm64)
run: npm run build -- --arch arm64
- name: Generate checksum
run: |
shasum -a 256 dist/*.dmg > dist/sha256sum.txt
shasum -a 256 dist/*.pkg >> dist/sha256sum.txt
shasum -a 256 dist/*.zip >> dist/sha256sum.txt
- name: Upload macOS Artifacts
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: macos-artifacts
path: |
dist/*.dmg
dist/*.pkg
dist/*.zip
dist/latest*.yml
dist/sha256sum.txt
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos]
outputs:
version_tag: ${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Get app version
id: version
uses: pchynoweth/action-get-npm-version@1.1.1
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
path: dist/linux
- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: dist/windows
- name: Download macOS Artifacts
uses: actions/download-artifact@v4
with:
name: macos-artifacts
path: dist/macos
- name: Display structure of downloaded files
run: ls -R dist
- name: Combine checksums
run: |
cat dist/linux/sha256sum.txt dist/windows/sha256sum.txt dist/macos/sha256sum.txt > sha256sums.txt
- name: Upload Release
id: create_release
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: "v${{ steps.version.outputs.version }}"
name: "bsky-desktop v${{ steps.version.outputs.version }}"
generate_release_notes: true
files: |
dist/linux/*.AppImage
dist/linux/*.deb
dist/linux/*.zip
dist/windows/*.exe
dist/windows/*.msi
dist/windows/*.appx
dist/windows/*.zip
dist/macos/*.dmg
dist/macos/*.pkg
dist/macos/*.zip
sha256sums.txt
aur:
name: Publish to AUR
runs-on: ubuntu-latest
needs: release
env:
AUR_TOKEN: ${{ secrets.AUR_TOKEN }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Download linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
path: dist/linux
- name: List downloaded files
run: ls -R dist
- name: Show content of sha256sum.txt
run: cat dist/linux/sha256sum.txt
- name: Get app version
id: version
uses: pchynoweth/action-get-npm-version@1.1.1
- name: Extract checksum from sha256sum.txt and change build version
run: |
new_checksum=$(awk 'NR==1 { print $1 }' ./dist/linux/sha256sum.txt)
sed -i "s|sha256sums=('SKIP' 'SKIP')|sha256sums=('$new_checksum' 'SKIP')|" ./build/arch-pkg/PKGBUILD
sed -i "s/^pkgver=.*$/pkgver=${{ steps.version.outputs.version }}/" ./build/arch-pkg/PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
with:
pkgname: bskydesktop
pkgbuild: ./build/arch-pkg/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: New Version
ssh_keyscan_types: rsa,ecdsa,ed25519