From 9a8a85e72dac8534b28acec54a031ce91af93e38 Mon Sep 17 00:00:00 2001 From: "Ben Hearsum (he/him)" Date: Wed, 30 Oct 2024 20:15:12 -0400 Subject: [PATCH] fix: replace setup-crane step with copypasta (#1051) This step is trivial enough that we may as well copy/paste rather than go through the trouble of getting it approved. --- .github/workflows/deploy.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a91b51606..5f5c1b7d7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -74,9 +74,24 @@ jobs: labels: ${{ steps.meta.outputs.labels }} context: . + # copypasta from https://github.com/imjasonh/setup-crane/blob/main/action.yml - name: Set up crane - if: ${{ github.event_name == 'release' }} - uses: imjasonh/setup-crane@v0.4 + shell: bash + run: | + set -ex + + out=crane + os=${{ runner.os }} + tag=$(curl -s -u "username:${{ github.token }}" https://api.github.com/repos/google/go-containerregistry/releases/latest | jq -r '.tag_name') + arch=$(uname -m) + tmp=$(mktemp -d) + cd ${tmp} + curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_${arch}.tar.gz | tar xz ${out} + chmod +x ${tmp}/${out} + PATH=${PATH}:${tmp} + echo "${tmp}" >> $GITHUB_PATH + echo "${{ github.token }}" | crane auth login ghcr.io --username "dummy" --password-stdin + - name: Tag and push # For releases, we specifically do _not_ want to rebuild, just tag the