diff --git a/.github/workflows/release-process.yml b/.github/workflows/release-process.yml index 86c3a71e6f..f38c6c59d2 100644 --- a/.github/workflows/release-process.yml +++ b/.github/workflows/release-process.yml @@ -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/checkout@v3.5.2 @@ -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,6 +57,19 @@ 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 }}" @@ -57,6 +77,19 @@ jobs: 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: