Skip to content

Commit

Permalink
fix: replace setup-crane step with copypasta (#1051)
Browse files Browse the repository at this point in the history
This step is trivial enough that we may as well copy/paste rather than go through the trouble of getting it approved.
  • Loading branch information
bhearsum authored Oct 31, 2024
1 parent 0615e7a commit 9a8a85e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down

0 comments on commit 9a8a85e

Please sign in to comment.