-
-
Notifications
You must be signed in to change notification settings - Fork 428
260 lines (230 loc) · 7.89 KB
/
build-release-image.yml
File metadata and controls
260 lines (230 loc) · 7.89 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
name: Build Release Image
on:
repository_dispatch:
types:
- cloudsmith-package-synchronised
permissions:
contents: read
id-token: write
packages: write
pages: write
jobs:
build-release-docker-image:
if: |
github.event.client_payload.data.repository == 'releases' &&
(github.event.client_payload.data.name == 'ponyc-x86-64-unknown-linux-alpine3.23.tar.gz' ||
github.event.client_payload.data.name == 'ponyc-arm64-unknown-linux-alpine3.23.tar.gz')
concurrency:
group: build-release-image
cancel-in-progress: true
name: Build release image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Set up Docker Buildx
# v3.10.0
uses: docker/setup-buildx-action@v4
with:
version: v0.23.0
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash .dockerfiles/release/build-and-push.bash
build-versioned-amd64-docker-image:
if: |
github.event.client_payload.data.repository == 'releases' &&
github.event.client_payload.data.name == 'ponyc-x86-64-unknown-linux-alpine3.23.tar.gz'
concurrency:
group: build-versioned-amd64-docker-image
cancel-in-progress: true
name: Build versioned amd64 release image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Set up Docker Buildx
# v3.10.0
uses: docker/setup-buildx-action@v4
with:
version: v0.23.0
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash .dockerfiles/release/build-and-push-versioned.bash
env:
VERSION: ${{ github.event.client_payload.data.version }}
build-versioned-arm64-docker-image:
if: |
github.event.client_payload.data.repository == 'releases' &&
github.event.client_payload.data.name == 'ponyc-arm64-unknown-linux-alpine3.23.tar.gz'
concurrency:
group: build-versioned-arm64-docker-image
cancel-in-progress: true
name: Build versioned arm64 release image
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Set up Docker Buildx
# v3.10.0
uses: docker/setup-buildx-action@v4
with:
version: v0.23.0
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash .dockerfiles/release/build-and-push-versioned.bash
env:
VERSION: ${{ github.event.client_payload.data.version }}
build-multiplatform-versioned-release-docker-image-triggered-by-amd64:
needs:
- build-versioned-amd64-docker-image
name: Create multiplatform versioned release image
runs-on: ubuntu-latest
concurrency:
group: build-multiplatform-versioned-release-docker-image
cancel-in-progress: true
steps:
- uses: actions/checkout@v6.0.2
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Merge
run: bash .dockerfiles/release/combine-versioned-images.bash
env:
VERSION: ${{ github.event.client_payload.data.version }}
build-multiplatform-versioned-release-docker-image-triggered-by-arm64:
needs:
- build-versioned-arm64-docker-image
name: Create multiplatform versioned release image
runs-on: ubuntu-latest
concurrency:
group: build-multiplatform-versioned-release-docker-image
cancel-in-progress: true
steps:
- uses: actions/checkout@v6.0.2
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Merge
run: bash .dockerfiles/release/combine-versioned-images.bash
env:
VERSION: ${{ github.event.client_payload.data.version }}
update-playground-image-on-release:
needs:
- build-release-docker-image
name: Update https://playground.ponylang.io/
runs-on: ubuntu-latest
steps:
- name: Run remote command
uses: ponylang-main/ssh-action@ffff33f8fe0318345a4f00f0e847325954b2a3ed
with:
host: ${{ secrets.PLAYGROUND_HOST }}
username: ${{ secrets.PLAYGROUND_ADMIN_USER }}
key: ${{ secrets.PLAYGROUND_KEY }}
script: bash update-playground.bash
update-stdlib-builder-image-on-release:
needs:
- build-release-docker-image
name: Update stdlib-builder Docker image with newly released ponyc version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Login to GitHub Container Registry
# v2.2.0
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: bash .ci-dockerfiles/stdlib-builder/build-and-push.bash
build-and-push-stdlib-documentation:
needs:
- update-stdlib-builder-image-on-release
name: Build and Push standard library documentation
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container:
image: ghcr.io/ponylang/ponyc-ci-stdlib-builder:release
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Build
run: "bash .ci-scripts/build-stdlib-documentation.bash"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'stdlib-docs/site/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
trigger-release-announcement:
needs:
- build-and-push-stdlib-documentation
- update-playground-image-on-release
name: Trigger release announcement
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v6.0.2
with:
ref: "main"
token: ${{ secrets.RELEASE_TOKEN }}
- name: Trigger
uses: docker://ghcr.io/ponylang/release-bot-action:0.6.5
with:
entrypoint: trigger-release-announcement
env:
GIT_USER_NAME: "Ponylang Main Bot"
GIT_USER_EMAIL: "ponylang.main@gmail.com"
CUSTOM_VERSION: ${{ github.event.client_payload.data.version }}
send-release-image-pushed-event:
needs:
- build-release-docker-image
name: Send release event
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
repo:
- ponylang/library-documentation-action
- ponylang/library-documentation-action-v2
- ponylang/shared-docker
steps:
- name: Send
# v2.1.1
uses: peter-evans/repository-dispatch@8324ecf35877f9b02961dd5aaf43ed7be7db9373
with:
token: ${{ secrets.PONYLANG_MAIN_API_TOKEN }}
repository: ${{ matrix.repo }}
event-type: ponyc-release-image-pushed
client-payload: '{"version": "${{ github.event.client_payload.data.version }}"}'