1+ name : " Push Client Examples Containers"
2+ description : " Push Client Examples container images with signing and SBOM"
3+
4+ inputs :
5+ architectures :
6+ description : " Comma-separated list of architectures (e.g., 'amd64,arm64,s390x,ppc64le')"
7+ required : true
8+ runnerArch :
9+ description : " Runner architecture (amd64, arm64)"
10+ required : false
11+ default : " amd64"
12+ quayUser :
13+ description : " Quay.io username"
14+ required : true
15+ quayPass :
16+ description : " Quay.io password"
17+ required : true
18+ buildRunId :
19+ description : " Build workflow run ID for artifact download"
20+ required : false
21+ default : " "
22+
23+ runs :
24+ using : " composite"
25+ steps :
26+ - name : Install Syft
27+ shell : bash
28+ run : |
29+ ARCH="${{ inputs.runnerArch }}"
30+ VERSION="0.90.0"
31+ wget https://github.com/anchore/syft/releases/download/v${VERSION}/syft_${VERSION}_linux_${ARCH}.tar.gz -O syft.tar.gz
32+ tar xf syft.tar.gz -C /tmp
33+ chmod +x /tmp/syft
34+ sudo mv /tmp/syft /usr/bin
35+
36+ - name : Install Cosign
37+ uses : sigstore/cosign-installer@v4.0.0
38+
39+ - name : Setup Docker
40+ uses : strimzi/strimzi-kafka-operator/.github/actions/dependencies/install-docker@main
41+
42+ - name : Download container artifacts from external build
43+ if : ${{ inputs.buildRunId != '' }}
44+ uses : actions/download-artifact@v7
45+ with :
46+ pattern : containers-*
47+ path : ./
48+ merge-multiple : true
49+ run-id : ${{ inputs.buildRunId }}
50+ github-token : ${{ github.token }}
51+
52+ - name : Download container artifacts from this workflow
53+ if : ${{ inputs.buildRunId == '' }}
54+ uses : actions/download-artifact@v7
55+ with :
56+ pattern : containers-*
57+ path : ./
58+ merge-multiple : true
59+
60+ - name : Extract container archives
61+ shell : bash
62+ run : |
63+ IFS=',' read -ra ARCH_ARRAY <<< "${{ inputs.architectures }}"
64+ for arch in "${ARCH_ARRAY[@]}"; do
65+ echo "Extracting containers-${arch}.tar"
66+ tar -xvf "containers-${arch}.tar"
67+ rm "containers-${arch}.tar"
68+ done
69+
70+ - name : Login to container registry
71+ shell : bash
72+ run : docker login -u ${{ inputs.quayUser }} -p ${{ inputs.quayPass }} ${{ env.DOCKER_REGISTRY }}
73+
74+ - name : Delete existing container manifests
75+ shell : bash
76+ run : make docker_delete_manifest
77+ env :
78+ BUILD_REASON : " IndividualCI"
79+ BRANCH : ${{ github.ref }}
80+
81+ - name : Push containers and create manifests
82+ shell : bash
83+ run : |
84+ IFS=',' read -ra ARCH_ARRAY <<< "${{ inputs.architectures }}"
85+ for arch in "${ARCH_ARRAY[@]}"; do
86+ echo "Processing architecture: ${arch}"
87+ export DOCKER_ARCHITECTURE="${arch}"
88+ make docker_load docker_tag docker_push docker_amend_manifest docker_delete_archive
89+ done
90+ env :
91+ BUILD_REASON : " IndividualCI"
92+ BRANCH : ${{ github.ref }}
93+
94+ - name : Push container manifests
95+ shell : bash
96+ run : make docker_push_manifest
97+ env :
98+ BUILD_REASON : " IndividualCI"
99+ BRANCH : ${{ github.ref }}
100+
101+ - name : Sign container manifests
102+ shell : bash
103+ run : make docker_gha_sign_manifest
104+ env :
105+ BUILD_REASON : " IndividualCI"
106+ BRANCH : ${{ github.ref }}
107+ BUILD_ID : ${{ github.run_number }}
108+ BUILD_COMMIT : ${{ github.sha }}
109+
110+ - name : Generate and sign SBOMs
111+ shell : bash
112+ run : |
113+ IFS=',' read -ra ARCH_ARRAY <<< "${{ inputs.architectures }}"
114+ for arch in "${ARCH_ARRAY[@]}"; do
115+ echo "Generating SBOM for architecture: ${arch}"
116+ export DOCKER_ARCHITECTURE="${arch}"
117+ make docker_gha_sbom
118+ done
119+ env :
120+ BUILD_REASON : " IndividualCI"
121+ BRANCH : ${{ github.ref }}
122+
123+ - name : Create SBOM archive
124+ shell : bash
125+ run : tar -z -C ./sbom/ -cvpf sbom.tar.gz ./
126+
127+ - name : Upload SBOM artifact
128+ uses : actions/upload-artifact@v5
129+ with :
130+ name : SBOMs-${{ env.DOCKER_TAG }}
131+ path : sbom.tar.gz
132+
133+ - name : Push SBOMs to registry
134+ if : ${{ startsWith(github.ref, 'refs/heads/release-') }}
135+ shell : bash
136+ run : |
137+ IFS=',' read -ra ARCH_ARRAY <<< "${{ inputs.architectures }}"
138+ for arch in "${ARCH_ARRAY[@]}"; do
139+ echo "Pushing SBOM for architecture: ${arch}"
140+ export DOCKER_ARCHITECTURE="${arch}"
141+ make docker_gha_push_sbom
142+ done
143+ env :
144+ BUILD_REASON : " IndividualCI"
145+ BRANCH : ${{ github.ref }}
146+ BUILD_ID : ${{ github.run_number }}
147+ BUILD_COMMIT : ${{ github.sha }}
0 commit comments