Skip to content

Commit

Permalink
Merge pull request #1491 from fluxcd/cosign
Browse files Browse the repository at this point in the history
ci: update cosign signing
  • Loading branch information
aryan9600 authored Aug 28, 2023
2 parents 5a809d7 + 7cce4fd commit 7af4498
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/push-ld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
- name: Publish image
id: build-push
uses: docker/build-push-action@v4
with:
push: true
Expand All @@ -58,4 +59,4 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign ${{ env.IMAGE }}:${{ steps.prep.outputs.VERSION }}
cosign sign --yes ${{ env.IMAGE }}@${{ steps.build-push.outputs.digest }}
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
tags: |
type=raw,value=${{ steps.prep.outputs.VERSION }}
- name: Publish image
id: build-push
uses: docker/build-push-action@v4
with:
sbom: true
Expand All @@ -76,7 +77,7 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign ${{ env.IMAGE }}:${{ steps.prep.outputs.VERSION }}
cosign sign --yes ${{ env.IMAGE }}@${{ steps.build-push.outputs.digest }}
- name: Publish Helm charts
if: startsWith(github.ref, 'refs/tags/v')
uses: stefanprodan/helm-gh-pages@v1.7.0
Expand All @@ -93,19 +94,22 @@ jobs:
COSIGN_EXPERIMENTAL: 1
run: |
helm package charts/flagger
helm push flagger-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/fluxcd/charts
cosign sign ghcr.io/fluxcd/charts/flagger:${{ steps.prep.outputs.VERSION }}
digest = $(helm push flagger-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/fluxcd/charts | awk '/Digest:/ {print $2}' | tr -d '\n' | xargs)
cosign sign --yes ghcr.io/fluxcd/charts/flagger@${{ digest }}
rm flagger-${{ steps.prep.outputs.VERSION }}.tgz
- name: Publish signed manifests to GHCR
if: startsWith(github.ref, 'refs/tags/v')
env:
COSIGN_EXPERIMENTAL: 1
run: |
flux push artifact oci://ghcr.io/fluxcd/flagger-manifests:${{ steps.prep.outputs.VERSION }} \
--path="./kustomize" \
--source="$(git config --get remote.origin.url)" \
--revision="${{ steps.prep.outputs.VERSION }}/$(git rev-parse HEAD)"
cosign sign ghcr.io/fluxcd/flagger-manifests:${{ steps.prep.outputs.VERSION }}
digest_url = $(flux push artifact \
oci://ghcr.io/fluxcd/flagger-manifests:${{ steps.prep.outputs.VERSION }} \
--path="./kustomize" \
--source="$(git config --get remote.origin.url)" \
--revision="${{ steps.prep.outputs.VERSION }}/$(git rev-parse HEAD)"
--output json | \
jq -r '. | .repository + "@" + .digest')
cosign sign --yes ${{ digest_url }}
- uses: anchore/sbom-action/download-syft@v0
- name: Create release and SBOM
uses: goreleaser/goreleaser-action@v4
Expand Down

0 comments on commit 7af4498

Please sign in to comment.