-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|