-
-
Notifications
You must be signed in to change notification settings - Fork 428
213 lines (198 loc) · 7.88 KB
/
build-nightly-image.yml
File metadata and controls
213 lines (198 loc) · 7.88 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
name: Build Nightly Image
on:
repository_dispatch:
types:
- cloudsmith-package-synchronised
permissions:
contents: read
packages: write
jobs:
build-nightly-docker-image:
if: |
github.event.client_payload.data.repository == 'nightlies' &&
(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-nightly-image
cancel-in-progress: true
name: Build nightly 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/nightly/build-and-push.bash
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
update-stdlib-builder-image-on-nightly:
needs:
- build-nightly-docker-image
name: Update stdlib-builder Docker image with nightly 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
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
test-building-stdlib-documentation:
needs:
- update-stdlib-builder-image-on-nightly
name: Test building standard library documentation
runs-on: ubuntu-latest
container:
image: ghcr.io/ponylang/ponyc-ci-stdlib-builder:nightly
steps:
- uses: actions/checkout@v6.0.2
- name: Build
run: "bash .ci-scripts/build-stdlib-documentation.bash"
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
prune-untagged-nightly-images:
needs:
- build-nightly-docker-image
name: Prune untagged nightly images
runs-on: ubuntu-latest
steps:
- 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: Fetch multi-platform image SHAs to preserve
id: multi-arch-digests
run: |
shas=""
for tag in nightly release; do
digests=$(docker manifest inspect "ghcr.io/ponylang/ponyc:${tag}" 2>/dev/null | jq -r '.manifests[].digest' | paste -s -d ',' - || true)
if [ -n "$digests" ]; then
shas="${shas:+${shas},}${digests}"
fi
done
echo "skip-shas=${shas}" >> $GITHUB_OUTPUT
- name: Prune
# v3.0.1
uses: snok/container-retention-policy@3b0972b2276b171b212f8c4efbca59ebba26eceb
with:
account: ponylang
token: ${{ secrets.GITHUB_TOKEN }}
image-names: ponyc
tag-selection: untagged
cut-off: 1d
skip-shas: ${{ steps.multi-arch-digests.outputs.skip-shas }}
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
prune-untagged-stdlib-builders:
needs:
- update-stdlib-builder-image-on-nightly
name: Prune untagged stdlib builders
runs-on: ubuntu-latest
steps:
- name: Prune
# v3.0.1
uses: snok/container-retention-policy@3b0972b2276b171b212f8c4efbca59ebba26eceb
with:
account: ponylang
token: ${{ secrets.GITHUB_TOKEN }}
image-names: ponyc-ci-stdlib-builder
tag-selection: untagged
cut-off: 1d
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.
send-nightly-image-pushed-event:
needs:
- build-nightly-docker-image
name: Send
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
repo:
- 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-nightly-image-pushed
client-payload: '{"version": "${{ github.event.client_payload.data.version }}"}'
- name: Alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.