Skip to content

Commit adc0648

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

File tree

4 files changed

+337
-158
lines changed

4 files changed

+337
-158
lines changed

.github/workflows/.test.yml

Lines changed: 153 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,90 @@ 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-upload: false
405+
file: test/hello.Dockerfile
406+
output: local
407+
platforms: linux/amd64,linux/arm64
408+
sbom: true
409+
410+
build-local-noupload-verify:
411+
uses: ./.github/workflows/verify.yml
412+
needs:
413+
- build-local-noupload
414+
with:
415+
builder-outputs: ${{ toJSON(needs.build-local-noupload.outputs) }}
416+
417+
build-local-noupload-outputs:
418+
runs-on: ubuntu-24.04
419+
needs:
420+
- build-local-noupload
421+
steps:
422+
-
423+
name: Builder outputs
424+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
425+
env:
426+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-noupload.outputs) }}
427+
with:
428+
script: |
429+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
430+
core.info(JSON.stringify(builderOutputs, null, 2));
431+
432+
build-local-nosign:
433+
uses: ./.github/workflows/build.yml
434+
permissions:
435+
contents: read
436+
id-token: write
437+
with:
438+
artifact-name: build-output-nosign
439+
artifact-upload: true
440+
file: test/hello.Dockerfile
441+
output: local
442+
platforms: linux/amd64,linux/arm64
443+
sbom: true
444+
sign: false
445+
446+
build-local-nosign-verify:
447+
uses: ./.github/workflows/verify.yml
448+
needs:
449+
- build-local-nosign
450+
with:
451+
builder-outputs: ${{ toJSON(needs.build-local-nosign.outputs) }}
452+
453+
build-local-nosign-outputs:
454+
runs-on: ubuntu-24.04
455+
needs:
456+
- build-local-nosign
457+
steps:
458+
-
459+
name: Builder outputs
460+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
461+
env:
462+
INPUT_BUILDER-OUTPUTS: ${{ toJSON(needs.build-local-nosign.outputs) }}
463+
with:
464+
script: |
465+
const builderOutputs = JSON.parse(core.getInput('builder-outputs'));
466+
core.info(JSON.stringify(builderOutputs, null, 2));
467+
343468
build-set-runner:
344469
uses: ./.github/workflows/build.yml
345470
permissions:
346471
contents: read
347472
id-token: write
348473
with:
349474
runner: amd64
475+
file: test/hello.Dockerfile
350476
output: image
477+
platforms: linux/amd64,linux/arm64
351478
push: false
352479
meta-images: ghcr.io/docker/github-builder-test
353480
meta-tags: |
354481
type=raw,value=build-${{ github.run_id }}
355-
build-file: test/hello.Dockerfile
356-
build-platforms: linux/amd64,linux/arm64
357482
358483
bake-aws-single:
359484
uses: ./.github/workflows/bake.yml

0 commit comments

Comments
 (0)