Skip to content

Commit a49c58d

Browse files
authored
fix windows build and test it (#6)
Signed-off-by: Jason Hall <jason@chainguard.dev>
1 parent 60b1c76 commit a49c58d

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/test.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ on:
1111
jobs:
1212
test:
1313
name: Basic Test
14+
defaults:
15+
run:
16+
shell: bash
1417
strategy:
1518
fail-fast: false
1619
matrix:
1720
os:
1821
- ubuntu-latest
1922
- macos-latest
20-
# - windows-latest TODO(jason): Enable when we install in the correct location.
23+
- windows-latest
2124
runs-on: ${{ matrix.os }}
2225

2326
steps:

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Setup `chainctl`
22

3+
[![Test](https://github.com/chainguard-dev/setup-chainctl/actions/workflows/test.yaml/badge.svg)](https://github.com/chainguard-dev/setup-chainctl/actions/workflows/test.yaml)
4+
35
This action installs the latest `chainctl` binary for a particular environment
46
and authenticates with it using identity tokens.
57

@@ -25,3 +27,9 @@ steps:
2527
```
2628
2729
See [Authenticating to Chainguard Registry](https://edu.chainguard.dev/chainguard/chainguard-images/registry/authenticating/#authenticating-with-github-actions) for more information about creating an identity to pull images from cgr.dev from GitHub Actions, using `setup-chainctl`.
30+
31+
# Runner Support
32+
33+
The action is tested to work on Linux, MacOS and Windows runners.
34+
35+
Note: If you use it on Windows, you must use `shell: bash`.

action.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ runs:
7272
fi
7373
7474
url="https://dl.${{ inputs.environment }}/chainctl/latest/chainctl_${os}_${arch}"
75+
out="chainctl"
7576
if [[ "${os}" == "windows" ]]; then
7677
url="${url}.exe"
78+
out="${out}.exe"
7779
fi
7880
echo "Downloading chainctl from ${url}"
7981
80-
curl -o ./chainctl -fsL "${url}"
81-
chmod +x ./chainctl
82-
mv ./chainctl /usr/local/bin
82+
curl -o ./${out} -fsL "${url}"
83+
chmod +x ./${out}
84+
echo "$(pwd)" >> $GITHUB_PATH
8385
8486
- name: Authenticate with Chainguard (assumed identity)
8587
shell: bash

0 commit comments

Comments
 (0)