File tree Expand file tree Collapse file tree 5 files changed +23
-1
lines changed
Expand file tree Collapse file tree 5 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 3838 BUILD_NUMBER : ${{ github.run_attempt }}
3939 JOB_NAME : ${{ github.job }}
4040 GH_API_KEY : ${{ secrets.GITHUB_TOKEN }}
41+ COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
42+ COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
4143 shell : bash
4244 run : |
4345 export TAG_NAME="${REF#*/tags/}"
Original file line number Diff line number Diff line change 3737 REF : ${{ github.event.ref }}
3838 BUILD_NUMBER : ${{ github.run_attempt }}
3939 JOB_NAME : ${{ github.job }}
40+ COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
41+ COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
4042 shell : bash
4143 run : |
4244 export TAG_NAME="${REF#*/tags/}"
Original file line number Diff line number Diff line change 3737 REF : ${{ github.event.ref }}
3838 BUILD_NUMBER : ${{ github.run_attempt }}
3939 JOB_NAME : ${{ github.job }}
40+ COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
41+ COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
4042 shell : bash
4143 run : |
4244 export TAG_NAME="${REF#*/tags/}"
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ echo "The image tag is: ${release_tag}"
3535bazel run --config=stamp -c opt --action_env=GOOGLE_APPLICATION_CREDENTIALS --//k8s:image_version=" ${release_tag} " \
3636 --//k8s:build_type=public //k8s/cloud:cloud_images_push
3737
38+ while read -r image;
39+ do
40+ image_digest=$( crane digest " ${image} " )
41+ cosign sign --key env://COSIGN_PRIVATE_KEY --yes -r " ${image} @${image_digest} "
42+ done < <( bazel run --config=stamp -c opt --action_env=GOOGLE_APPLICATION_CREDENTIALS --//k8s:image_version=" ${release_tag} " \
43+ --//k8s:build_type=public //k8s/cloud:list_image_bundle)
44+
3845all_licenses_opts=(" //tools/licenses:all_licenses" " --action_env=GOOGLE_APPLICATION_CREDENTIALS" " --remote_download_outputs=toplevel" )
3946all_licenses_path=" $( bazel cquery " ${all_licenses_opts[@]} " --output starlark --starlark:expr " target.files.to_list()[0].path" 2> /dev/null) "
4047bazel build " ${all_licenses_opts[@]} "
Original file line number Diff line number Diff line change 1616#
1717# SPDX-License-Identifier: Apache-2.0
1818
19+ sign_image () {
20+ multiarch_image=" $1 "
21+ image_digest=" $2 "
22+
23+ cosign sign --key env://COSIGN_PRIVATE_KEY --yes -r " ${multiarch_image} @${image_digest} "
24+ }
25+
1926push_images_for_arch () {
2027 arch=" $1 "
2128 image_rule=" $2 "
@@ -38,7 +45,9 @@ push_multiarch_image() {
3845 # instead it seems to just ignore images that already exist in the local manifest.
3946 docker manifest rm " ${multiarch_image} " || true
4047 docker manifest create " ${multiarch_image} " " ${x86_image} " " ${aarch64_image} "
41- docker manifest push " ${multiarch_image} "
48+ pushed_digest=$( docker manifest push " ${multiarch_image} " )
49+
50+ sign_image " ${multiarch_image} " " ${pushed_digest} "
4251}
4352
4453push_all_multiarch_images () {
You can’t perform that action at this time.
0 commit comments