Skip to content

Commit

Permalink
chore: fix checksum generation (#2481)
Browse files Browse the repository at this point in the history
* chore: fix checksum generation and sign sbom

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* cosign public key for public record

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>

* remove pub key for cosign

Signed-off-by: zachaller <zachaller@users.noreply.github.com>

Signed-off-by: Justin Marquis <34fathombelow@protonmail.com>
Signed-off-by: zachaller <zachaller@users.noreply.github.com>
Co-authored-by: zachaller <zachaller@users.noreply.github.com>
  • Loading branch information
34fathombelow and zachaller committed Dec 15, 2022
1 parent dcd20ad commit f780534
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
- name: Generate release artifacts
run: |
make release-plugins
make checksums
make manifests IMAGE_TAG=${{ github.event.inputs.tag }}
- name: Generate SBOM (spdx)
Expand Down Expand Up @@ -144,6 +145,54 @@ jobs:
cd /tmp && tar -zcf sbom.tar.gz *.spdx
- name: Login to Quay.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.1'

- name: Install crane to get digest of image
uses: imjasonh/setup-crane@v0.2

- name: Get digest of controller-image
run: |
echo "CONTROLLER_DIGEST=$(crane digest quay.io/argoproj/argo-rollouts:${{ github.event.inputs.tag }})" >> $GITHUB_ENV
- name: Get digest of plugin-image
run: |
echo "PLUGIN_DIGEST=$(crane digest quay.io/argoproj/kubectl-argo-rollouts:${{ github.event.inputs.tag }})" >> $GITHUB_ENV
- name: Sign Argo Rollouts Images
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argo-rollouts@${{ env.CONTROLLER_DIGEST }}
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/kubectl-argo-rollouts@${{ env.PLUGIN_DIGEST }}
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}

- name: Sign checksums and create public key for release assets
run: |
cosign sign-blob --key env://COSIGN_PRIVATE_KEY ./dist/argo-rollouts-checksums.txt > ./dist/argo-rollouts-checksums.sig
cosign public-key --key env://COSIGN_PRIVATE_KEY > ./dist/argo-rollouts-cosign.pub
cosign sign-blob --key env://COSIGN_PRIVATE_KEY /tmp/sbom.tar.gz > /tmp/sbom.tar.gz.sig
# Displays the public key to share.
cosign public-key --key env://COSIGN_PRIVATE_KEY
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}

- name: update stable tag for docs
run: |
git tag -f stable ${{ github.event.inputs.tag }}
git push -f origin stable
- name: Draft release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -160,5 +209,6 @@ jobs:
manifests/notifications-install.yaml
docs/features/kustomize/rollout_cr_schema.json
/tmp/sbom.tar.gz
/tmp/sbom.tar.gz.sig
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,7 @@ release: release-precheck precheckin image plugin-image release-plugins
trivy:
@trivy fs --clear-cache
@trivy fs .

.PHONY: checksums
checksums:
shasum -a 256 ./dist/kubectl-argo-rollouts-* | awk -F './dist/' '{print $$1 $$2}' > ./dist/argo-rollouts-checksums.txt

0 comments on commit f780534

Please sign in to comment.