-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1497 from fluxcd/fix-cosign
ci: Fix cosign signatures
- Loading branch information
Showing
1 changed file
with
17 additions
and
16 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 |
---|---|---|
|
@@ -80,6 +80,19 @@ jobs: | |
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
cosign sign --yes ${{ env.IMAGE }}@${{ steps.build-push.outputs.digest }} | ||
- name: Publish signed manifests to GHCR | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
OCI_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 ${OCI_URL} | ||
- name: Publish Helm charts | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: stefanprodan/[email protected] | ||
|
@@ -89,29 +102,17 @@ jobs: | |
linting: off | ||
- uses: fluxcd/pkg/actions/helm@main | ||
with: | ||
version: 3.10.1 | ||
version: 3.12.3 | ||
- name: Publish signed Helm chart to GHCR | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: | | ||
helm package charts/flagger | ||
echo "DIGEST=$(helm push flagger-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/fluxcd/charts | awk '/Digest:/ {print $2}' | tr -d '\n' | xargs)" >> $GITHUB_ENV | ||
cosign sign --yes ghcr.io/fluxcd/charts/flagger@$DIGEST | ||
helm push flagger-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/fluxcd/charts |& tee .digest | ||
cosign sign --yes ghcr.io/fluxcd/charts/flagger@$(cat .digest | awk -F "[, ]+" '/Digest/{print $NF}') | ||
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: | | ||
echo "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')" >> $GITHUB_ENV | ||
cosign sign --yes $DIGEST_URL | ||
rm .digest | ||
- uses: anchore/sbom-action/download-syft@v0 | ||
- name: Create release and SBOM | ||
id: run-goreleaser | ||
|