-
Notifications
You must be signed in to change notification settings - Fork 992
368 lines (366 loc) · 14.4 KB
/
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# @generated by generate-release-yml.rs
---
name: release
"on":
push:
tags:
- v*
permissions:
contents: write # to create a release
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
release: "${{ steps.info.outputs.name }}"
upload_url: "${{ steps.create_release.outputs.upload_url }}"
steps:
- name: Prepare release info
id: info
env:
TAG: "${{ github.ref }}"
run: "python -c \"print('::set-output name=name::' + '$TAG'.lstrip('refs/tags/'))\""
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
tag_name: "${{ github.ref }}"
release_name: "${{ github.ref }}"
docker-ubuntu-20:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "."
build-args: UBUNTU_VERSION=20.04
file: watchman/build/package/ubuntu-env/Dockerfile
push: true
tags: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-20:latest', github.repository) }}"
docker-ubuntu-22:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "."
build-args: UBUNTU_VERSION=22.04
file: watchman/build/package/ubuntu-env/Dockerfile
push: true
tags: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-22:latest', github.repository) }}"
docker-fedora-36:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "."
build-args: FEDORA_VERSION=36
file: watchman/build/package/fedora-env/Dockerfile
push: true
tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-36:latest', github.repository) }}"
docker-fedora-37:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "."
build-args: FEDORA_VERSION=37
file: watchman/build/package/fedora-env/Dockerfile
push: true
tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-37:latest', github.repository) }}"
docker-fedora-38:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "."
build-args: FEDORA_VERSION=38
file: watchman/build/package/fedora-env/Dockerfile
push: true
tags: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}"
clone-build-package-ubuntu-20:
needs:
- prepare
- docker-ubuntu-20
runs-on: ubuntu-latest
container:
image: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-20:latest', github.repository) }}"
steps:
- name: Fix HOME
run: echo HOME=/root >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Install system dependencies
run: "./install-system-packages.sh"
- name: Fix dubious ownership
run: git config --global --add safe.directory /__w/watchman/watchman
- name: Build Watchman binaries
run: "./autogen.sh"
- name: Make .deb
env:
UBUNTU_VERSION: "20.04"
run: "./watchman/build/package/make-deb.sh"
- name: Upload .deb
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: /_debs/watchman.deb
asset_name: "watchman_ubuntu20.04_${{ needs.prepare.outputs.release }}.deb"
asset_content_type: application/x-deb
clone-build-package-ubuntu-22:
needs:
- prepare
- docker-ubuntu-22
runs-on: ubuntu-latest
container:
image: "${{ format('ghcr.io/{0}/watchman-build-env-ubuntu-22:latest', github.repository) }}"
steps:
- name: Fix HOME
run: echo HOME=/root >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Install system dependencies
run: "./install-system-packages.sh"
- name: Fix dubious ownership
run: git config --global --add safe.directory /__w/watchman/watchman
- name: Build Watchman binaries
run: "./autogen.sh"
- name: Make .deb
env:
UBUNTU_VERSION: "22.04"
run: "./watchman/build/package/make-deb.sh"
- name: Upload .deb
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: /_debs/watchman.deb
asset_name: "watchman_ubuntu22.04_${{ needs.prepare.outputs.release }}.deb"
asset_content_type: application/x-deb
clone-build-package-fedora-36:
needs:
- prepare
- docker-fedora-36
runs-on: ubuntu-latest
container:
image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-36:latest', github.repository) }}"
steps:
- name: Fix HOME
run: echo HOME=/root >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Install system dependencies
run: "./install-system-packages.sh"
- name: Fix dubious ownership
run: git config --global --add safe.directory /__w/watchman/watchman
- name: Build Watchman binaries
run: "./autogen.sh"
- name: Make .rpm
id: make_rpm
env:
FEDORA_VERSION: "36"
run: "./watchman/build/package/make-rpm.sh"
- name: Upload .rpm
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "${{ steps.make_rpm.outputs.rpm_path }}"
asset_name: "${{ steps.make_rpm.outputs.rpm_name }}"
asset_content_type: application/x-rpm
clone-build-package-fedora-37:
needs:
- prepare
- docker-fedora-37
runs-on: ubuntu-latest
container:
image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-37:latest', github.repository) }}"
steps:
- name: Fix HOME
run: echo HOME=/root >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Install system dependencies
run: "./install-system-packages.sh"
- name: Fix dubious ownership
run: git config --global --add safe.directory /__w/watchman/watchman
- name: Build Watchman binaries
run: "./autogen.sh"
- name: Make .rpm
id: make_rpm
env:
FEDORA_VERSION: "37"
run: "./watchman/build/package/make-rpm.sh"
- name: Upload .rpm
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "${{ steps.make_rpm.outputs.rpm_path }}"
asset_name: "${{ steps.make_rpm.outputs.rpm_name }}"
asset_content_type: application/x-rpm
clone-build-package-fedora-38:
needs:
- prepare
- docker-fedora-38
runs-on: ubuntu-latest
container:
image: "${{ format('ghcr.io/{0}/watchman-build-env-fedora-38:latest', github.repository) }}"
steps:
- name: Fix HOME
run: echo HOME=/root >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: Install system dependencies
run: "./install-system-packages.sh"
- name: Fix dubious ownership
run: git config --global --add safe.directory /__w/watchman/watchman
- name: Build Watchman binaries
run: "./autogen.sh"
- name: Make .rpm
id: make_rpm
env:
FEDORA_VERSION: "38"
run: "./watchman/build/package/make-rpm.sh"
- name: Upload .rpm
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "${{ steps.make_rpm.outputs.rpm_path }}"
asset_name: "${{ steps.make_rpm.outputs.rpm_name }}"
asset_content_type: application/x-rpm
linux-build:
continue-on-error: true
needs: prepare
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build watchman
run: "python3 build/fbcode_builder/getdeps.py build --src-dir=. watchman --project-install-prefix watchman:/usr/local"
- name: Copy artifacts
run: "python3 build/fbcode_builder/getdeps.py fixup-dyn-deps --strip --src-dir=. watchman _artifacts/linux --project-install-prefix watchman:/usr/local --final-install-prefix /usr/local"
- name: Test watchman
run: "python3 build/fbcode_builder/getdeps.py test --src-dir=. watchman --project-install-prefix watchman:/usr/local"
- name: Package watchman
run: "mv _artifacts/linux \"watchman-${{ needs.prepare.outputs.release }}-linux\" && zip -r watchman-${{ needs.prepare.outputs.release }}-linux.zip \"watchman-${{ needs.prepare.outputs.release }}-linux/\""
- name: Upload Linux release
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "./watchman-${{ needs.prepare.outputs.release }}-linux.zip"
asset_name: "watchman-${{ needs.prepare.outputs.release }}-linux.zip"
asset_content_type: application/zip
mac-build:
continue-on-error: true
needs: prepare
runs-on: macOS-10.15
steps:
- uses: actions/checkout@v2
- name: Build watchman
run: "SDKROOT=$(xcrun --show-sdk-path --sdk macosx11.1) python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. watchman --project-install-prefix watchman:/usr/local"
- name: Copy artifacts
run: "python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --src-dir=. watchman _artifacts/mac --project-install-prefix watchman:/usr/local --final-install-prefix /usr/local"
- name: Test watchman
run: "python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. watchman --project-install-prefix watchman:/usr/local"
- name: Package watchman
run: "mv _artifacts/mac \"watchman-${{ needs.prepare.outputs.release }}-macos\" && zip -r watchman-${{ needs.prepare.outputs.release }}-macos.zip \"watchman-${{ needs.prepare.outputs.release }}-macos/\""
- name: Upload macOS release
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "./watchman-${{ needs.prepare.outputs.release }}-macos.zip"
asset_name: "watchman-${{ needs.prepare.outputs.release }}-macos.zip"
asset_content_type: application/zip
windows-build:
continue-on-error: true
needs: prepare
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Export boost environment
run: echo BOOST_ROOT=%BOOST_ROOT_1_69_0% >> %GITHUB_ENV%
shell: cmd
- name: Fix Git config
run: git config --system core.longpaths true
- name: Build watchman
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. watchman
- name: Copy artifacts
run: python build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --src-dir=. watchman _artifacts/windows --final-install-prefix /usr/local
- name: Test watchman
run: python build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. watchman
- name: Package watchman
run: "mv _artifacts/windows \"watchman-${{ needs.prepare.outputs.release }}-windows\" && Compress-Archive -DestinationPath \"watchman-${{ needs.prepare.outputs.release }}-windows.zip\" -Path \"watchman-${{ needs.prepare.outputs.release }}-windows/\""
- name: Upload Windows release
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: actions/upload-release-asset@v1
with:
upload_url: "${{ needs.prepare.outputs.upload_url }}"
asset_path: "./watchman-${{ needs.prepare.outputs.release }}-windows.zip"
asset_name: "watchman-${{ needs.prepare.outputs.release }}-windows.zip"
asset_content_type: application/zip