1 Commits

Author SHA1 Message Date
Jason Hall 54699f91ad support and test Windows
Signed-off-by: Jason Hall <jason@chainguard.dev>
2024-06-11 13:00:16 -04:00
2 changed files with 27 additions and 11 deletions
+14 -8
View File
@@ -1,6 +1,8 @@
name: Use Action
on:
pull_request:
branches: ['main']
push:
branches: ['main']
@@ -8,34 +10,38 @@ jobs:
use-action:
name: Use Action
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
- uses: actions/checkout@v2
go-version: 1.21.x
- uses: actions/checkout@v4
- uses: imjasonh/setup-crane@main
- uses: ./
- run: |
crane digest ubuntu
crane manifest ubuntu | jq
crane copy ubuntu ghcr.io/${{ github.repository }}/ubuntu-copy
- name: Install old release
uses: imjasonh/setup-crane@main
uses: ./
with:
version: v0.12.0
- name: Check installed version
run: crane version | grep 0.12.0
- name: Install from tip
uses: imjasonh/setup-crane@main
uses: ./
with:
version: tip
- name: Check installed version (tip)
run: |
sudo rm /usr/local/bin/crane # Uninstall previous versions.
rm $(which crane) # Uninstall previous versions.
crane version
+13 -3
View File
@@ -35,15 +35,25 @@ runs:
if [[ $os == "macOS" ]]; then
os="Darwin"
fi
arch=$(uname -m)
if [[ "$arch" =~ (aarch64|arm64) ]] ; then
arch=arm64
fi
fi
out=crane
if [[ "${os}" == "Windows" ]]; then
out=crane.exe
fi
if [[ ! -z ${tag} ]]; then
echo "Installing crane @ ${tag} for ${os} on ${arch}"
curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_${arch}.tar.gz | sudo tar xzf - -C /usr/local/bin crane
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
fi
# NB: username doesn't seem to matter.