@@ -598,12 +598,24 @@ jobs:
598
598
strategy :
599
599
fail-fast : false
600
600
matrix :
601
- attrs :
602
- - ' '
603
- - mode=max
604
- - builder-id=foo
605
- - false
606
- - true
601
+ include :
602
+ - target : image
603
+ output : type=image,name=localhost:5000/name/app:latest,push=true
604
+ attr : mode=max
605
+ - target : image
606
+ output : type=image,name=localhost:5000/name/app:latest,push=true
607
+ attr : ' '
608
+ - target : binary
609
+ output : /tmp/buildx-build
610
+ attr : mode=max
611
+ - target : binary
612
+ output : /tmp/buildx-build
613
+ attr : ' '
614
+ services :
615
+ registry :
616
+ image : registry:2
617
+ ports :
618
+ - 5000:5000
607
619
steps :
608
620
-
609
621
name : Checkout
@@ -622,11 +634,24 @@ jobs:
622
634
with :
623
635
context : ./test/go
624
636
file : ./test/go/Dockerfile
625
- target : binary
626
- outputs : type=oci,dest=/tmp/build.tar
627
- provenance : ${{ matrix.attrs }}
628
- cache-from : type=gha,scope=provenance
629
- cache-to : type=gha,scope=provenance,mode=max
637
+ target : ${{ matrix.target }}
638
+ outputs : ${{ matrix.output }}
639
+ provenance : ${{ matrix.attr }}
640
+ -
641
+ name : Inspect Provenance
642
+ if : matrix.target == 'image'
643
+ run : |
644
+ docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .Provenance}}'
645
+ -
646
+ name : Check output folder
647
+ if : matrix.target == 'binary'
648
+ run : |
649
+ tree /tmp/buildx-build
650
+ -
651
+ name : Print local Provenance
652
+ if : matrix.target == 'binary'
653
+ run : |
654
+ cat /tmp/buildx-build/provenance.json | jq
630
655
631
656
sbom :
632
657
runs-on : ubuntu-latest
@@ -667,22 +692,17 @@ jobs:
667
692
cache-from : type=gha,scope=attests-${{ matrix.target }}
668
693
cache-to : type=gha,scope=attests-${{ matrix.target }},mode=max
669
694
-
670
- name : Inspect image
695
+ name : Inspect SBOM
671
696
if : matrix.target == 'image'
672
697
run : |
673
- docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
698
+ docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .SBOM }}'
674
699
-
675
700
name : Check output folder
676
701
if : matrix.target == 'binary'
677
702
run : |
678
703
tree /tmp/buildx-build
679
704
-
680
- name : Print provenance
681
- if : matrix.target == 'binary'
682
- run : |
683
- cat /tmp/buildx-build/provenance.json | jq
684
- -
685
- name : Print SBOM
705
+ name : Print local SBOM
686
706
if : matrix.target == 'binary'
687
707
run : |
688
708
cat /tmp/buildx-build/sbom.spdx.json | jq
0 commit comments