Skip to content

Commit 516a267

Browse files
committed
build: refactor inputs
Signed-off-by: CrazyMax <[email protected]>
1 parent 36714db commit 516a267

File tree

4 files changed

+311
-144
lines changed

4 files changed

+311
-144
lines changed

.github/workflows/.test.yml

Lines changed: 154 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ jobs:
2121
contents: read
2222
id-token: write
2323
with:
24+
cache: true
25+
file: test/hello.Dockerfile
2426
output: image
2527
push: ${{ github.event_name != 'pull_request' }}
26-
cache: true
28+
sbom: true
2729
meta-images: |
2830
public.ecr.aws/q3b5f1u4/test-docker-action
2931
meta-tags: |
3032
type=raw,value=build-ghbuilder-single-${{ github.run_id }}
31-
build-file: test/hello.Dockerfile
32-
build-sbom: true
33+
3334
secrets:
3435
registry-auths: |
3536
- registry: public.ecr.aws
@@ -70,17 +71,17 @@ jobs:
7071
contents: read
7172
id-token: write
7273
with:
73-
output: image
74-
push: ${{ github.event_name != 'pull_request' }}
7574
cache: true
7675
cache-scope: build-aws
76+
file: test/hello.Dockerfile
77+
output: image
78+
platforms: linux/amd64,linux/arm64
79+
push: ${{ github.event_name != 'pull_request' }}
80+
sbom: true
7781
meta-images: |
7882
public.ecr.aws/q3b5f1u4/test-docker-action
7983
meta-tags: |
8084
type=raw,value=build-ghbuilder-${{ github.run_id }}
81-
build-file: test/hello.Dockerfile
82-
build-sbom: true
83-
build-platforms: linux/amd64,linux/arm64
8485
secrets:
8586
registry-auths: |
8687
- registry: public.ecr.aws
@@ -115,21 +116,73 @@ jobs:
115116
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
116117
core.info(JSON.stringify(builderOutputs, null, 2));
117118
119+
build-aws-nosign:
120+
uses: ./.github/workflows/build.yml
121+
permissions:
122+
contents: read
123+
id-token: write
124+
with:
125+
cache: true
126+
cache-scope: build-aws
127+
file: test/hello.Dockerfile
128+
output: image
129+
platforms: linux/amd64,linux/arm64
130+
push: ${{ github.event_name != 'pull_request' }}
131+
sbom: true
132+
sign: false
133+
meta-images: |
134+
public.ecr.aws/q3b5f1u4/test-docker-action
135+
meta-tags: |
136+
type=raw,value=build-ghbuilder-nosign--${{ github.run_id }}
137+
secrets:
138+
registry-auths: |
139+
- registry: public.ecr.aws
140+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
141+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
142+
143+
build-aws-nosign-verify:
144+
uses: ./.github/workflows/verify.yml
145+
if: ${{ github.event_name != 'pull_request' }}
146+
needs:
147+
- build-aws-nosign
148+
with:
149+
builder-outputs: ${{ toJSON(needs.build-aws-nosign.outputs) }}
150+
secrets:
151+
registry-auths: |
152+
- registry: public.ecr.aws
153+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
154+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
155+
156+
build-aws-nosign-outputs:
157+
runs-on: ubuntu-24.04
158+
needs:
159+
- build-aws-nosign
160+
steps:
161+
-
162+
name: Builder outputs
163+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
164+
env:
165+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-aws-nosign.outputs) }}
166+
with:
167+
script: |
168+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
169+
core.info(JSON.stringify(builderOutputs, null, 2));
170+
118171
build-ghcr:
119172
uses: ./.github/workflows/build.yml
120173
permissions:
121174
contents: read
122175
id-token: write
123176
packages: write
124177
with:
178+
file: test/hello.Dockerfile
125179
output: image
180+
platforms: linux/amd64,linux/arm64
126181
push: ${{ github.event_name != 'pull_request' }}
182+
sbom: true
127183
meta-images: ghcr.io/docker/github-builder-test
128184
meta-tags: |
129185
type=raw,value=build-${{ github.run_id }}
130-
build-file: test/hello.Dockerfile
131-
build-sbom: true
132-
build-platforms: linux/amd64,linux/arm64
133186
secrets:
134187
registry-auths: |
135188
- registry: ghcr.io
@@ -170,14 +223,14 @@ jobs:
170223
contents: read
171224
id-token: write
172225
with:
226+
file: test/hello.Dockerfile
173227
output: image
228+
platforms: linux/amd64,linux/arm64
174229
push: ${{ github.event_name != 'pull_request' }}
230+
sbom: true
175231
meta-images: registry-1-stage.docker.io/docker/github-builder-test
176232
meta-tags: |
177233
type=raw,value=build-${{ github.run_id }}
178-
build-file: test/hello.Dockerfile
179-
build-sbom: true
180-
build-platforms: linux/amd64,linux/arm64
181234
secrets:
182235
registry-auths: |
183236
- registry: registry-1-stage.docker.io
@@ -219,16 +272,16 @@ jobs:
219272
id-token: write
220273
packages: write
221274
with:
275+
file: test/hello.Dockerfile
222276
output: image
277+
platforms: linux/amd64,linux/arm64
223278
push: ${{ github.event_name != 'pull_request' }}
279+
sbom: true
224280
meta-images: |
225281
ghcr.io/docker/github-builder-test
226282
public.ecr.aws/q3b5f1u4/test-docker-action
227283
meta-tags: |
228284
type=raw,value=${{ github.run_id }},prefix=build-ghcr-and-aws-
229-
build-file: test/hello.Dockerfile
230-
build-sbom: true
231-
build-platforms: linux/amd64,linux/arm64
232285
secrets:
233286
registry-auths: |
234287
- registry: ghcr.io
@@ -275,12 +328,13 @@ jobs:
275328
contents: read
276329
id-token: write
277330
with:
278-
output: local
279-
push: ${{ github.event_name != 'pull_request' }}
280331
artifact-name: build-output
281-
build-file: test/hello.Dockerfile
282-
build-sbom: true
283-
build-platforms: linux/amd64,linux/arm64
332+
artifact-upload: true
333+
file: test/hello.Dockerfile
334+
output: local
335+
platforms: linux/amd64,linux/arm64
336+
sbom: true
337+
sign: ${{ github.event_name != 'pull_request' }}
284338

285339
build-local-verify:
286340
uses: ./.github/workflows/verify.yml
@@ -311,11 +365,12 @@ jobs:
311365
contents: read
312366
id-token: write
313367
with:
314-
output: local
315-
push: ${{ github.event_name != 'pull_request' }}
316368
artifact-name: build-output-single
317-
build-file: test/hello.Dockerfile
318-
build-sbom: true
369+
artifact-upload: true
370+
file: test/hello.Dockerfile
371+
output: local
372+
sbom: true
373+
sign: ${{ github.event_name != 'pull_request' }}
319374

320375
build-local-single-verify:
321376
uses: ./.github/workflows/verify.yml
@@ -340,20 +395,91 @@ jobs:
340395
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
341396
core.info(JSON.stringify(builderOutputs, null, 2));
342397
398+
build-local-noupload:
399+
uses: ./.github/workflows/build.yml
400+
permissions:
401+
contents: read
402+
id-token: write
403+
with:
404+
artifact-name: build-output
405+
artifact-upload: false
406+
file: test/hello.Dockerfile
407+
output: local
408+
platforms: linux/amd64,linux/arm64
409+
sbom: true
410+
411+
build-local-noupload-verify:
412+
uses: ./.github/workflows/verify.yml
413+
needs:
414+
- build-local-noupload
415+
with:
416+
builder-outputs: ${{ toJSON(needs.build-local-noupload.outputs) }}
417+
418+
build-local-noupload-outputs:
419+
runs-on: ubuntu-24.04
420+
needs:
421+
- build-local-noupload
422+
steps:
423+
-
424+
name: Builder outputs
425+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
426+
env:
427+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-noupload.outputs) }}
428+
with:
429+
script: |
430+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
431+
core.info(JSON.stringify(builderOutputs, null, 2));
432+
433+
build-local-nosign:
434+
uses: ./.github/workflows/build.yml
435+
permissions:
436+
contents: read
437+
id-token: write
438+
with:
439+
artifact-name: build-output
440+
artifact-upload: true
441+
file: test/hello.Dockerfile
442+
output: local
443+
platforms: linux/amd64,linux/arm64
444+
sbom: true
445+
sign: false
446+
447+
build-local-nosign-verify:
448+
uses: ./.github/workflows/verify.yml
449+
needs:
450+
- build-local-nosign
451+
with:
452+
builder-outputs: ${{ toJSON(needs.build-local-nosign.outputs) }}
453+
454+
build-local-nosign-outputs:
455+
runs-on: ubuntu-24.04
456+
needs:
457+
- build-local-nosign
458+
steps:
459+
-
460+
name: Builder outputs
461+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
462+
env:
463+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-nosign.outputs) }}
464+
with:
465+
script: |
466+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
467+
core.info(JSON.stringify(builderOutputs, null, 2));
468+
343469
build-set-runner:
344470
uses: ./.github/workflows/build.yml
345471
permissions:
346472
contents: read
347473
id-token: write
348474
with:
349475
runner: amd64
476+
file: test/hello.Dockerfile
350477
output: image
478+
platforms: linux/amd64,linux/arm64
351479
push: false
352480
meta-images: ghcr.io/docker/github-builder-test
353481
meta-tags: |
354482
type=raw,value=build-${{ github.run_id }}
355-
build-file: test/hello.Dockerfile
356-
build-platforms: linux/amd64,linux/arm64
357483
358484
bake-aws-single:
359485
uses: ./.github/workflows/bake.yml

0 commit comments

Comments
 (0)