File tree 2 files changed +27
-11
lines changed
2 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 1
1
name : Use Action
2
2
3
3
on :
4
+ pull_request :
5
+ branches : ['main']
4
6
push :
5
7
branches : ['main']
6
8
7
9
jobs :
8
10
use-action :
9
11
name : Use Action
10
12
strategy :
13
+ fail-fast : false
11
14
matrix :
12
- platform : [ubuntu-latest, macos-latest]
15
+ platform : [ubuntu-latest, macos-latest, windows-latest ]
13
16
runs-on : ${{ matrix.platform }}
17
+ defaults :
18
+ run :
19
+ shell : bash
14
20
15
21
steps :
16
- - uses : actions/setup-go@v2
22
+ - uses : actions/setup-go@v5
17
23
with :
18
- go-version : 1.20 .x
19
- - uses : actions/checkout@v2
24
+ go-version : 1.21 .x
25
+ - uses : actions/checkout@v4
20
26
21
- - uses : imjasonh/setup-crane@main
27
+ - uses : ./
22
28
- run : |
23
29
crane digest ubuntu
24
30
crane manifest ubuntu | jq
25
31
crane copy ubuntu ghcr.io/${{ github.repository }}/ubuntu-copy
26
32
27
33
- name : Install old release
28
- uses : imjasonh/setup-crane@main
34
+ uses : ./
29
35
with :
30
36
version : v0.12.0
31
37
- name : Check installed version
32
38
run : crane version | grep 0.12.0
33
39
34
40
- name : Install from tip
35
- uses : imjasonh/setup-crane@main
41
+ uses : ./
36
42
with :
37
43
version : tip
38
44
- name : Check installed version (tip)
39
45
run : |
40
- sudo rm /usr/local/bin/ crane # Uninstall previous versions.
46
+ rm $(which crane) # Uninstall previous versions.
41
47
crane version
Original file line number Diff line number Diff line change @@ -35,15 +35,25 @@ runs:
35
35
if [[ $os == "macOS" ]]; then
36
36
os="Darwin"
37
37
fi
38
-
38
+
39
39
arch=$(uname -m)
40
40
if [[ "$arch" =~ (aarch64|arm64) ]] ; then
41
41
arch=arm64
42
- fi
42
+ fi
43
+
44
+ out=crane
45
+ if [[ "${os}" == "Windows" ]]; then
46
+ out=crane.exe
47
+ fi
43
48
44
49
if [[ ! -z ${tag} ]]; then
45
50
echo "Installing crane @ ${tag} for ${os} on ${arch}"
46
- 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
51
+ tmp=$(mktemp -d)
52
+ cd ${tmp}
53
+ curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_${arch}.tar.gz | tar xz ${out}
54
+ chmod +x ${tmp}/${out}
55
+ PATH=${PATH}:${tmp}
56
+ echo "${tmp}" >> $GITHUB_PATH
47
57
fi
48
58
49
59
# NB: username doesn't seem to matter.
You can’t perform that action at this time.
0 commit comments