diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cdfeb0846a38..86125b255545 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -175,7 +175,7 @@ jobs: login-server: quay.io username: ${{ secrets.QUAYIO_USERNAME }} password: ${{ secrets.QUAYIO_PASSWORD }} - + - name: Build & Push Windows Docker Images env: DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }} @@ -195,6 +195,7 @@ jobs: docker tag $image_name quay.io/$image_name docker push quay.io/$image_name + done push-images: @@ -217,9 +218,16 @@ jobs: username: ${{ secrets.QUAYIO_USERNAME }} password: ${{ secrets.QUAYIO_PASSWORD }} + - name: Install cosign + uses: sigstore/cosign-installer@main + with: + cosign-release: 'v1.13.0' + - name: Push Multiarch Image env: DOCKERIO_ORG: ${{ secrets.DOCKERIO_ORG }} + COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}} + COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}} run: | echo $(jq -c '. + { "experimental": "enabled" }' ${DOCKER_CONFIG}/config.json) > ${DOCKER_CONFIG}/config.json @@ -244,6 +252,9 @@ jobs: docker manifest push $image_name docker manifest push quay.io/$image_name + + cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/$image_name + done test-images-linux-amd64: @@ -327,6 +338,8 @@ jobs: needs: [ push-images, test-images-linux-amd64, test-images-windows ] env: NODE_OPTIONS: --max-old-space-size=4096 + COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}} + COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}} steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -347,6 +360,10 @@ jobs: with: path: /home/runner/go/pkg/mod key: GOMODCACHE-v2-${{ hashFiles('**/go.mod') }} + - name: Install cosign + uses: sigstore/cosign-installer@main + with: + cosign-release: 'v1.13.0' # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions - run: | if [ ${GITHUB_REF##*/} = master ]; then @@ -376,6 +393,12 @@ jobs: - name: Print version (please check it is not dirty) run: dist/argo-linux-amd64 version - run: make checksums + - name: Sign checksums and create public key for release assets + run: | + cosign sign-blob --key env://COSIGN_PRIVATE_KEY ./dist/argo-workflows-cli-checksums.txt > ./dist/argo-workflows-cli-checksums.sig + # Retrieves the public key to release as an asset + cosign public-key --key env://COSIGN_PRIVATE_KEY > ./dist/argo-workflows-cosign.pub + # https://github.com/softprops/action-gh-release # This will publish the release and upload assets. # If a conflict occurs (because you are not on a tag), the release will not be updated. This is a short coming @@ -388,8 +411,10 @@ jobs: body_path: release-notes files: | dist/argo-*.gz - dist/argo-*.gz.sha256 + dist/argo-workflows-cli-checksums.txt + dist/argo-workflows-cli-checksums.sig dist/manifests/*.yaml + dist/argo-workflows-cosign.pub dist/sbom.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 1a269afbc773..acf5defaa090 100644 --- a/Makefile +++ b/Makefile @@ -677,4 +677,5 @@ release-notes: /dev/null .PHONY: checksums checksums: - for f in ./dist/argo-*.gz; do openssl dgst -sha256 "$$f" | awk ' { print $$2 }' > "$$f".sha256 ; done + sha256sum ./dist/argo-*.gz | awk -F './dist/' '{print $$1 $$2}' > ./dist/argo-workflows-cli-checksums.txt +