10 Commits

Author SHA1 Message Date
Jason Hall 00c9e93efa update Go and crane versions used in CI test 2023-02-15 14:33:48 -05:00
Jason Hall 779a7240f2 Merge pull request #6 from bbednarek/imjasonh/setup-crane/issues/5
Download crane binary corresponding to underlying runner architecture
2023-02-15 13:48:03 -05:00
bbednarek 8a78c724ed fix env variable 2023-02-15 17:27:44 +01:00
bbednarek 77ab8b6716 handle aarch64 and arm64 2023-02-15 17:19:05 +01:00
bbednarek 67a61a0d45 Download crane binary corresponding to underlying runner architecture 2023-02-15 16:53:00 +01:00
Jason Hall e82f1b9a80 Merge pull request #3 from n3wscott/go1.18
use go install
2022-07-25 21:17:32 -04:00
Scott Nichols ee5bee9817 use go install 2022-07-25 17:40:07 -07:00
Jason Hall 01d2668281 update README 2021-07-23 11:52:13 -04:00
Jason Hall 0201011286 fix use-action variable 2021-07-23 11:51:25 -04:00
Jason Hall 743562b092 fix readme, have action copy to ghcr.io 2021-07-23 11:34:26 -04:00
3 changed files with 16 additions and 8 deletions
+7 -4
View File
@@ -15,18 +15,21 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.20.x
- uses: actions/checkout@v2
- uses: imjasonh/setup-crane@main
- run: crane digest ubuntu
- 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
with:
version: v0.4.0
version: v0.12.0
- name: Check installed version
run: crane version | grep 0.4.0
run: crane version | grep 0.12.0
- name: Install from tip
uses: imjasonh/setup-crane@main
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
- run: |
crane digest ubuntu
crane manifest ubuntu | jq
crane copy ubuntu ghcr.io/${{ github.owner
crane copy ubuntu ghcr.io/${{ github.repository }}/ubuntu-copy
```
_That's it!_ This workflow will inspect and copy the `ubuntu` image to your repo's GitHub container registry namespace.
+8 -3
View File
@@ -22,7 +22,7 @@ runs:
case ${{ inputs.version }} in
tip)
echo "Installing crane using go get"
go get github.com/google/go-containerregistry/cmd/crane@main
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')
@@ -35,10 +35,15 @@ runs:
if [[ $os == "macOS" ]]; then
os="Darwin"
fi
arch=$(uname -m)
if [[ "$arch" =~ (aarch64|arm64) ]] ; then
arch=arm64
fi
if [[ ! -z ${tag} ]]; then
echo "Installing crane @ ${tag} for ${os}"
curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_x86_64.tar.gz | sudo tar xzf - -C /usr/local/bin crane
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
fi
# NB: username doesn't seem to matter.