-
Notifications
You must be signed in to change notification settings - Fork 6
295 lines (285 loc) · 11.2 KB
/
obs.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
name: obs
on:
pull_request:
workflow_dispatch:
inputs:
revision:
default: main
description: Branch or Tag to be published
type: string
skip-bundles:
default: false
description: Skip bundling and only stage+test+release
type: boolean
skip-stage:
default: false
description: Skip staging and only bundles+test+release
type: boolean
skip-tests:
default: false
description: Skip testing and only bundles+stage+release
type: boolean
skip-release:
default: false
description: Skip releasing and only bundles+stage+test
type: boolean
env:
REVISION: ${{ inputs.revision || 'main' }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
run-name: publish on OBS / ${{ inputs.revision || 'main' }}
jobs:
vars:
runs-on: ubuntu-latest
timeout-minutes: 300
outputs:
archive_path: ${{ steps.step.outputs.ARCHIVE_PATH }}
commit: ${{ steps.step.outputs.COMMIT }}
git_root: ${{ steps.step.outputs.GIT_ROOT }}
project: ${{ steps.step.outputs.PROJECT }}
project_type: ${{ steps.step.outputs.PROJECT_TYPE }}
project_version: ${{ steps.step.outputs.PROJECT_VERSION }}
version: ${{ steps.step.outputs.VERSION }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: step
run: |
source scripts/vars
echo "ARCHIVE_PATH=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"
echo "COMMIT=$COMMIT" >> "$GITHUB_OUTPUT"
echo "GIT_ROOT=$GIT_ROOT" >> "$GITHUB_OUTPUT"
echo "PROJECT=$PROJECT" >> "$GITHUB_OUTPUT"
echo "PROJECT_TYPE=$PROJECT_TYPE" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$PROJECT_VERSION" >> "$GITHUB_OUTPUT"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- run: scripts/github-job-wait
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT: ${{ steps.step.outputs.commit }}
GH_TOKEN: ${{ github.token }}
- name: COMMIT=${{ steps.step.outputs.commit }}
run: true
bundles:
runs-on: ubuntu-latest
needs: vars
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
- ppc64le
- s390x
name: bundle / build / ${{ inputs.revision || 'main' }} / ${{ matrix.arch }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- run: scripts/bundle/build
if: ${{ inputs.skip-bundles == false }}
env:
ARCH: ${{ matrix.arch }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: ${{ inputs.skip-bundles == false }}
with:
name: bundles-${{ matrix.arch }}
path: build/bundle/*.tar.gz*
bundle-test:
name: bundle / test / ${{ inputs.revision || 'main' }} / amd64
runs-on: ubuntu-latest
needs:
- vars
- bundles
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ inputs.skip-bundles == false }}
with:
name: bundles-amd64
path: build/bundle
- run: sudo -E scripts/bundle/test
if: ${{ inputs.skip-bundles == false }}
env:
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
bundles-publish:
name: bundles / publish / ${{ inputs.revision || 'main' }}
runs-on: ubuntu-latest
needs: bundle-test
permissions:
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
credentials_json: ${{ secrets.GCS_CRIO_SA }}
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-amd64
path: build/bundle
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-arm64
path: build/bundle
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-ppc64le
path: build/bundle
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: bundles-s390x
path: build/bundle
- run: scripts/sign-artifacts
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
- uses: google-github-actions/upload-cloud-storage@386ab77f37fdf51c0e38b3d229fad286861cc0d0 # v2.2.1
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
path: build/bundle
destination: cri-o/artifacts
parent: false
process_gcloudignore: false
- name: Create bundle marker
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
run: find . -type f -iname "cri-o.amd64.*.tar.gz" | sed -n 's;.*amd64.\(.*\).tar.gz;\1;p' > latest-bundle-${{ inputs.revision || 'main' }}.txt
- name: Upload bundle marker
uses: google-github-actions/upload-cloud-storage@386ab77f37fdf51c0e38b3d229fad286861cc0d0 # v2.2.1
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
path: latest-bundle-${{ inputs.revision || 'main' }}.txt
destination: cri-o
process_gcloudignore: false
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: ${{ inputs.skip-bundles == false && github.event_name != 'pull_request' }}
with:
name: signatures
path: |
build/bundle/*.sig
build/bundle/*.cert
stage:
runs-on: ubuntu-latest
name: stage / ${{ inputs.revision || 'main' }}
timeout-minutes: 240
needs:
- vars
- bundles-publish
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: scripts/obs
if: ${{ inputs.skip-stage == false && github.event_name != 'pull_request' }}
env:
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
test-kubernetes:
runs-on: ubuntu-latest
timeout-minutes: 120
needs:
- vars
- stage
strategy:
fail-fast: false
matrix:
type:
- deb
- rpm
name: test / ${{ matrix.type }} / kubernetes / amd64
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: sudo scripts/github-actions-setup
if: ${{ inputs.skip-tests == false }}
- run: sudo -E scripts/test-kubernetes
if: ${{ inputs.skip-tests == false }}
env:
TYPE: ${{ matrix.type }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
test-architectures:
runs-on: ubuntu-latest
timeout-minutes: 120
needs:
- vars
- stage
strategy:
fail-fast: false
matrix:
run:
- image: almalinux:9.2
type: rpm
- image: fedora:39
type: rpm
- image: debian:12
type: deb
- image: ubuntu:22.04
type: deb
arch:
- amd64
- arm64
- ppc64le
- s390x
exclude:
- run:
image: fedora:39
arch: arm64 # takes forever
name: test / ${{ matrix.run.type }} / ${{ matrix.run.image }} / ${{ matrix.arch }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- run: scripts/test-architectures
if: ${{ inputs.skip-tests == false }}
env:
IMAGE: ${{ matrix.run.image }}
ARCH: ${{ matrix.arch }}
TYPE: ${{ matrix.run.type }}
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}
release:
runs-on: ubuntu-latest
name: release / ${{ inputs.revision || 'main' }}
needs:
- vars
- test-architectures
- test-kubernetes
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: scripts/obs
if: ${{ inputs.skip-release == false && github.event_name != 'pull_request' }}
env:
RUN_RELEASE: 1
ARCHIVE_PATH: ${{ needs.vars.outputs.archive_path }}
COMMIT: ${{ needs.vars.outputs.commit }}
GIT_ROOT: ${{ needs.vars.outputs.git_root }}
PROJECT: ${{ needs.vars.outputs.project }}
PROJECT_TYPE: ${{ needs.vars.outputs.project_type }}
PROJECT_VERSION: ${{ needs.vars.outputs.project_version }}
VERSION: ${{ needs.vars.outputs.version }}