-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signature verification added for kapp-controller artifacts
Signed-off-by: rcmadhankumar <[email protected]>
- Loading branch information
1 parent
0594982
commit 94fe6fc
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ jobs: | |
kapp-controller-release: | ||
name: kapp-controller release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
@@ -37,6 +41,9 @@ jobs: | |
with: | ||
go-version: 1.21.1 | ||
|
||
- name: Set up Cosign | ||
uses: sigstore/cosign-installer@v3 | ||
|
||
- name: Run release script | ||
run: | | ||
set -e -x | ||
|
@@ -50,13 +57,39 @@ jobs: | |
./hack/build-binaries.sh | ||
cp ./kctrl-* ../release/ | ||
- name: Sign kapp-controller OCI image | ||
run: | | ||
image_url=`yq e '.spec.template.spec.containers[] | select(.name == "kapp-controller") | .image' release/release.yml` | ||
cosign sign --yes "$image_url" | ||
- name: Verify signature on Kapp-controller OCI image | ||
run: | | ||
image_url=`yq e '.spec.template.spec.containers[] | select(.name == "kapp-controller") | .image' release/release.yml` | ||
cosign verify \ | ||
$image_url \ | ||
--certificate-identity-regexp=https://github.com/carvel-dev \ | ||
--certificate-oidc-issuer=https://token.actions.githubusercontent.com | ||
- name: Run Package build | ||
run: | | ||
constraintVersion="${{ github.ref_name }}" | ||
./cli/kctrl-linux-amd64 pkg release -y -v ${constraintVersion:1} --debug | ||
mv ./carvel-artifacts/packages/kapp-controller.carvel.dev/metadata.yml ./carvel-artifacts/packages/kapp-controller.carvel.dev/package-metadata.yml | ||
mv ./carvel-artifacts/packages/kapp-controller.carvel.dev/* release/ | ||
- name: Sign kapp-controller-package-bundle OCI image | ||
run: | | ||
image_url=`yq e '.spec.template.spec.fetch[0].imgpkgBundle.image' release/package.yml` | ||
cosign sign --yes "$image_url" | ||
- name: Verify signature on kapp-controller-package-bundle OCI image | ||
run: | | ||
image_url=`yq e '.spec.template.spec.fetch[0].imgpkgBundle.image' release/package.yml` | ||
cosign verify \ | ||
$image_url \ | ||
--certificate-identity-regexp=https://github.com/carvel-dev \ | ||
--certificate-oidc-issuer=https://token.actions.githubusercontent.com | ||
- name: Add to formatted checksum | ||
run: | | ||
pushd release | ||
|
@@ -67,6 +100,18 @@ jobs: | |
cat ./tmp/checksums.txt | tee -a ./tmp/checksums-formatted.txt | ||
echo '```' | tee -a ./tmp/checksums-formatted.txt | ||
- name: Sign checksums.txt | ||
run: | | ||
cosign sign-blob --yes ./tmp/checksums.txt --output-certificate release/checksums.pem --output-signature release/checksums.sig | ||
- name: Verify checksums signature | ||
run: | | ||
cosign verify-blob \ | ||
--cert release/checksums.pem \ | ||
--signature release/checksums.sig \ | ||
--certificate-identity-regexp=https://github.com/carvel-dev \ | ||
--certificate-oidc-issuer=https://token.actions.githubusercontent.com ./tmp/checksums.txt | ||
- name: Create release draft and upload release yaml | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
with: | ||
|