From dc3617cd29b8ca3f1d9f2d71dc2e98a79ba2d978 Mon Sep 17 00:00:00 2001 From: Scott Dixon Date: Wed, 3 Apr 2024 21:21:27 -0700 Subject: [PATCH 1/2] Fixing toolshed.yml didn't get the logic right to trigger on tag. --- .github/workflows/toolshed.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/toolshed.yml b/.github/workflows/toolshed.yml index febe259..ace14f8 100644 --- a/.github/workflows/toolshed.yml +++ b/.github/workflows/toolshed.yml @@ -13,7 +13,7 @@ env: jobs: release-ts: - if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') && github.event.release.prerelease ) }} + if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/ts') ) }} runs-on: ubuntu-latest strategy: matrix: @@ -50,17 +50,17 @@ jobs: context: toolshed platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name == 'pull_request' && 'false' || 'true' }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name == 'pull_request' && !github.event.release.prerelease) && 'false' || 'true' }} - name: Export digest - if: ${{ github.event_name != 'pull_request'}} + if: ${{ github.event_name != 'pull_request'}} || run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest - if: ${{ github.event_name != 'pull_request'}} + if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease }} uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} From 97323ab6583f56334c8958b295da1f4eec972bac Mon Sep 17 00:00:00 2001 From: Scott Dixon Date: Wed, 3 Apr 2024 21:26:47 -0700 Subject: [PATCH 2/2] Update toolshed.yml --- .github/workflows/toolshed.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/toolshed.yml b/.github/workflows/toolshed.yml index ace14f8..ad7868e 100644 --- a/.github/workflows/toolshed.yml +++ b/.github/workflows/toolshed.yml @@ -50,16 +50,16 @@ jobs: context: toolshed platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name == 'pull_request' && !github.event.release.prerelease) && 'false' || 'true' }} - - - name: Export digest - if: ${{ github.event_name != 'pull_request'}} || + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ (github.event_name != 'pull_request' && !github.event.release.prerelease) && 'true' || 'false' }} + + - name: Export digest + if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease}} run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest + + - name: Upload digest if: ${{ github.event_name != 'pull_request' && !github.event.release.prerelease }} uses: actions/upload-artifact@v4 with: @@ -74,19 +74,17 @@ jobs: needs: - release-ts steps: - - - name: Download digests + - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: @@ -100,13 +98,12 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Create manifest list and push + - name: Create manifest list and push working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - - name: Inspect image + + - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}