diff --git a/.github/workflows/on_push_to_main.yaml b/.github/workflows/on_push_to_main.yaml index ff804a31..1e44aefb 100644 --- a/.github/workflows/on_push_to_main.yaml +++ b/.github/workflows/on_push_to_main.yaml @@ -7,6 +7,24 @@ env: FS_IMAGE: ghcr.io/${{ github.repository }} jobs: + set-version: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + with: + # need to get everything so that 'git describe' works + fetch-depth: 0 + + - run: | + echo "export GIT_COMMIT=$(git rev-parse --short HEAD)" >> vars.sh + echo "export GIT_TAG=$(git describe)" >> vars.sh + + - uses: actions/upload-artifact@v3 + with: + name: vars.sh + path: vars.sh + release-docker: runs-on: ubuntu-22.04 @@ -30,19 +48,18 @@ jobs: if: matrix.platform == 'linux/arm64' - uses: actions/checkout@v3 - with: - # need to get everything so that 'git describe' works - fetch-depth: 0 - uses: wistia/parse-tool-versions@v1.0 - uses: earthly/actions-setup@v1 with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" } + - uses: actions/download-artifact@v3 + with: + name: vars.sh + - name: extract sha - run: | - echo "GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TAG=$(git describe)" >> $GITHUB_ENV + run: source vars.sh - name: login to registry uses: docker/login-action@v1 @@ -57,8 +74,8 @@ jobs: --platform ${{ matrix.platform.earthly }} \ --push \ +docker \ - --GIT_TAG=${{ env.GIT_TAG }} \ - --GIT_COMMIT=${{ env.GIT_COMMIT }} \ + --GIT_TAG=${GIT_TAG} \ + --GIT_COMMIT=${GIT_COMMIT} \ --IMAGE_NAME=${{ env.FS_IMAGE }}:${{ env.GIT_TAG }} release-multiarch: @@ -71,11 +88,6 @@ jobs: packages: write steps: - - name: extract sha - run: | - echo "GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TAG=$(git describe)" >> $GITHUB_ENV - - name: login to registry uses: docker/login-action@v1 with: @@ -83,9 +95,16 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/download-artifact@v3 + with: + name: vars.sh + + - name: extract sha + run: source vars.sh + - uses: int128/docker-manifest-create-action@v1 with: - tags: ghcr.io/${{ github.repository_owner }}/kubechecks:${{ env.GIT_TAG }} + tags: ghcr.io/${{ github.repository_owner }}/kubechecks:${env.GIT_TAG} suffixes: | -linux-amd64 # -linux-arm64