5 Commits

Author SHA1 Message Date
claude-ceo-assistant a629bf00f7 chore: remove upstream CI workflows (mirror inertization per internal#233) 2026-05-10 14:28:50 +00:00
Jason Hall 6da1ae0188 Merge pull request #17 from markusthoemmes/reliability
Use Action / Use Action (macos-latest) (push) Waiting to run
Use Action / Use Action (windows-latest) (push) Waiting to run
Use Action / Use Action (ubuntu-latest) (push) Failing after 1s
Skip release lookup and retry download errors
2026-02-04 10:31:23 -05:00
Markus Thömmes a224f66917 Skip release lookup and retry download errors
This improves resiliency of the crane download. It skips the release lookup and uses a `latest` URL instead (dropping a request that can fail) and it adds retries to the actual download.
2026-02-04 11:15:58 +01:00
Jason Hall 7b22c9e892 Update README.md 2026-02-02 14:51:15 -05:00
Jason Hall 31b88efe9d Merge pull request #12 from imjasonh/windows
update use-action for Windows
2024-06-11 13:05:58 -04:00
3 changed files with 9 additions and 54 deletions
-47
View File
@@ -1,47 +0,0 @@
name: Use Action
on:
pull_request:
branches: ['main']
push:
branches: ['main']
jobs:
use-action:
name: Use Action
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
- uses: actions/checkout@v4
- uses: ./
- run: |
crane digest ubuntu
crane manifest ubuntu | jq
crane copy ubuntu ghcr.io/${{ github.repository }}/ubuntu-copy
- name: Install old release
uses: ./
with:
version: v0.12.0
- name: Check installed version
run: crane version | grep 0.12.0
- name: Install from tip
uses: ./
with:
version: tip
- name: Check installed version (tip)
run: |
rm $(which crane) # Uninstall previous versions.
crane version
+1 -1
View File
@@ -1,4 +1,4 @@
# GitHub Action to install and setup [`crane`](https://github.com/google/go-containerregistry/cmd/crane/README.md)
# GitHub Action to install and setup [`crane`](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md)
[![Build](https://github.com/imjasonh/setup-crane/actions/workflows/use-action.yaml/badge.svg)](https://github.com/imjasonh/setup-crane/actions/workflows/use-action.yaml)
+8 -6
View File
@@ -17,7 +17,7 @@ runs:
# Install crane:
# - if version is "tip", install from tip of main.
# - if version is "latest-release", look up latest release.
# - if version is "latest-release", use the latest release URL.
# - otherwise, install the specified version.
case ${{ inputs.version }} in
tip)
@@ -25,10 +25,10 @@ runs:
go install github.com/google/go-containerregistry/cmd/crane@main
;;
latest-release)
tag=$(curl -s -u "username:${{ github.token }}" https://api.github.com/repos/google/go-containerregistry/releases/latest | jq -r '.tag_name')
url="https://github.com/google/go-containerregistry/releases/latest/download"
;;
*)
tag="${{ inputs.version }}"
url="https://github.com/google/go-containerregistry/releases/download/${{ inputs.version }}"
esac
os=${{ runner.os }}
@@ -46,11 +46,13 @@ runs:
out=crane.exe
fi
if [[ ! -z ${tag} ]]; then
echo "Installing crane @ ${tag} for ${os} on ${arch}"
if [[ ! -z ${url} ]]; then
echo "Installing crane for ${os} on ${arch}"
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}
fname="go-containerregistry_${os}_${arch}.tar.gz"
curl -o "$fname" -fsSL --retry 5 --retry-delay 1 --retry-all-errors "${url}/${fname}"
tar xzf "$fname" ${out}
chmod +x ${tmp}/${out}
PATH=${PATH}:${tmp}
echo "${tmp}" >> $GITHUB_PATH