-
-
Notifications
You must be signed in to change notification settings - Fork 427
346 lines (321 loc) · 13.2 KB
/
release.yml
File metadata and controls
346 lines (321 loc) · 13.2 KB
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
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
concurrency: release
permissions:
packages: read
jobs:
# validation to assure that we should in fact continue with the release should
# be done here. the primary reason for this step is to verify that the release
# was started correctly by pushing a `release-X.Y.Z` tag rather than `X.Y.Z`.
pre-artefact-creation:
name: Tasks to run before artefact creation
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v6.0.2
with:
ref: "main"
token: ${{ secrets.RELEASE_TOKEN }}
- name: Validate CHANGELOG
uses: docker://ghcr.io/ponylang/release-bot-action:0.6.4
with:
entrypoint: pre-artefact-changelog-check
x86_64-linux:
needs:
- pre-artefact-creation
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu24.04-builder:20250115
name: x86-64-unknown-linux-ubuntu24.04
triple-os: linux-ubuntu24.04
triple-vendor: unknown
- image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230924
name: x86-64-unknown-linux-ubuntu22.04
triple-os: linux-ubuntu22.04
triple-vendor: unknown
- image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-alpine3.21-builder:20250510
name: x86-64-unknown-linux-alpine3.21
triple-os: linux-alpine3.21
triple-vendor: unknown
- image: ghcr.io/ponylang/ponyc-ci-alpine3.22-builder:20251022
name: x86-64-unknown-linux-alpine3.22
triple-os: linux-alpine3.22
triple-vendor: unknown
- image: ghcr.io/ponylang/ponyc-ci-alpine3.23-builder:20260201
name: x86-64-unknown-linux-alpine3.23
triple-os: linux-alpine3.23
triple-vendor: unknown
name: ${{ matrix.name }}
container:
image: ${{ matrix.image }}
options: --user pony
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: make libs build_flags=-j8
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Release
run: bash .ci-scripts/x86-64-release.bash
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
TRIPLE_VENDOR: ${{ matrix.triple-vendor }}
TRIPLE_OS: ${{ matrix.triple-os }}
# Currently, Github actions supplied by GH like checkout and cache do not work
# in musl libc environments on arm64. We can work around this by running
# those actions on the host and then "manually" doing our work that would
# normally be done "in the musl container" by starting the container ourselves
# for various steps by invoking docker directly.
#
# This is not in line with our standard pattern of "just do it all in the
# container" but is required to work around the GitHub actions limitation
# documented above.
arm64-linux:
needs:
- pre-artefact-creation
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
include:
- image: ghcr.io/ponylang/ponyc-ci-arm64-unknown-linux-alpine3.21-builder:20250510
name: arm64-unknown-linux-alpine3.21
triple-os: linux-alpine3.21
- image: ghcr.io/ponylang/ponyc-ci-alpine3.22-builder:20251022
name: arm64-unknown-linux-alpine3.22
triple-os: linux-alpine3.22
- image: ghcr.io/ponylang/ponyc-ci-alpine3.23-builder:20260201
name: arm64-unknown-linux-alpine3.23
triple-os: linux-alpine3.23
- image: ghcr.io/ponylang/ponyc-ci-arm64-unknown-linux-ubuntu24.04-builder:20250510
name: arm64-unknown-linux-ubuntu24.04
triple-os: linux-ubuntu24.04
triple-vendor: unknown
name: ${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker image
run: docker pull ${{ matrix.image }}
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: |
docker run --rm \
--user pony \
-v ${{ github.workspace }}:/home/pony/project \
-w /home/pony/project \
${{ matrix.image }} \
make libs build_flags=-j8
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Release
run: |
docker run --rm \
--user pony \
-v ${{ github.workspace }}:/home/pony/project \
-w /home/pony/project \
-e CLOUDSMITH_API_KEY=${{ secrets.CLOUDSMITH_API_KEY }} \
-e TRIPLE_OS=${{ matrix.triple-os }} \
${{ matrix.image }} \
bash .ci-scripts/arm64-unknown-linux-release.bash
x86_macos:
needs:
- pre-artefact-creation
runs-on: macos-26-intel
name: x86-64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-x86-macos-26-intel-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: make libs build_flags=-j2
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-x86-macos-26-intel-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Install Cloudsmith
run: pip3 install --break-system-packages --upgrade cloudsmith-cli
- name: Release
run: bash .ci-scripts/x86-64-release.bash
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
TRIPLE_VENDOR: apple
TRIPLE_OS: darwin
arm64_macos:
needs:
- pre-artefact-creation
runs-on: macos-26
name: arm64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-arm64-macos-26-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: make libs build_flags=-j4
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-arm64-macos-26-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Install Cloudsmith
run: pip3 install --upgrade --break-system-packages cloudsmith-cli
- name: Release
run: bash .ci-scripts/arm64-apple-darwin-release.bash
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
x86_64-windows:
needs:
- pre-artefact-creation
runs-on: windows-2025
defaults:
run:
shell: pwsh
name: x86-64-pc-windows-msvc
steps:
- name: Disable Windows Defender
run: Set-MpPreference -DisableRealtimeMonitoring $true
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Install Dependencies
run: |
function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args }; msys ' '; msys 'pacman --noconfirm -Syuu'; msys 'pacman --noconfirm -Syuu'; msys 'pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-lldb'; msys 'pacman --noconfirm -Scc'
python.exe -m pip install --upgrade cloudsmith-cli
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-windows-2025-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: .\make.ps1 -Command libs
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-windows-2025-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Configure
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
- name: Build
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
- name: Install
run: .\make.ps1 -Command install -Config Release -Prefix "build\install\release"
- name: Package
run: .\make.ps1 -Command package-x86-64 -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
- name: Upload
run: $version = (Get-Content .\VERSION); cloudsmith push raw --version $version --api-key ${{ secrets.CLOUDSMITH_API_KEY }} --summary "Pony compiler" --description "https://github.com/ponylang/ponyc" ponylang/releases build\ponyc-x86-64-pc-windows-msvc.zip
arm64-windows:
needs:
- pre-artefact-creation
runs-on: windows-11-arm
defaults:
run:
shell: pwsh
name: arm64-pc-windows-msvc
steps:
- name: Disable Windows Defender
run: Set-MpPreference -DisableRealtimeMonitoring $true
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Install Dependencies
run: |
python.exe -m pip install --upgrade cloudsmith-cli
- name: Restore Libs Cache
id: restore-libs
uses: actions/cache/restore@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-windows-11-arm-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Build Libs
if: steps.restore-libs.outputs.cache-hit != 'true'
run: .\make.ps1 -Command libs -Arch ARM64
- name: Save Libs Cache
if: steps.restore-libs.outputs.cache-hit != 'true'
uses: actions/cache/save@v5.0.3
with:
path: |
build/libs
lib/llvm/src/compiler-rt/lib/builtins
key: libs-windows-11-arm-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
- name: Configure
run: .\make.ps1 -Command configure -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION) -Arch ARM64
- name: Build
run: .\make.ps1 -Command build -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
- name: Install
run: .\make.ps1 -Command install -Config Release -Prefix "build\install\release"
- name: Package
run: .\make.ps1 -Command package-arm64 -Config Release -Prefix "build\install\release" -Version (Get-Content .\VERSION)
- name: Upload
run: $version = (Get-Content .\VERSION); cloudsmith push raw --version $version --api-key ${{ secrets.CLOUDSMITH_API_KEY }} --summary "Pony compiler" --description "https://github.com/ponylang/ponyc" ponylang/releases build\ponyc-arm64-pc-windows-msvc.zip