From 0a87fb8b9969c9e981205ff76219e3d8a53c8919 Mon Sep 17 00:00:00 2001 From: dogukanoksuz Date: Tue, 26 Dec 2023 11:18:29 +0300 Subject: [PATCH] fix: Version issue on workflows --- .github/workflows/docker-publish.yml | 29 +++------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cb9178e4..110c7d6b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -26,15 +26,7 @@ jobs: run: | VERSION=`cat storage/VERSION` echo "RELEASE_VER=$(echo $VERSION)" >> $GITHUB_ENV - echo "RELEASE_RUNNUMBER=$(echo $GITHUB_RUN_NUMBER)" >> $GITHUB_ENV - - # Install the cosign tool except on PR - # https://github.com/sigstore/cosign-installer - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 - with: - cosign-release: 'v2.1.1' + echo "RELEASE_RUNNUMBER=$(echo ($GITHUB_RUN_NUMBER+874))" >> $GITHUB_ENV # Set up BuildKit Docker container builder to be able to build # multi-platform images and export cache @@ -68,22 +60,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }} + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max - - # Sign the resulting Docker image digest except on PRs. - # This will only write to the public Rekor transparency log when the Docker - # repository is public to avoid leaking data. If you would like to publish - # transparency data even for private images, pass --force to cosign below. - # https://github.com/sigstore/cosign - - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} - env: - # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - TAGS: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }} - DIGEST: ${{ steps.build-and-push.outputs.digest }} - # This step uses the identity token to provision an ephemeral certificate - # against the sigstore community Fulcio instance. - run: echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}" | xargs -I {} cosign sign --yes {}@${DIGEST} \ No newline at end of file + cache-to: type=gha,mode=max \ No newline at end of file