Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows build and test it #6

Merged
merged 5 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ on:
jobs:
test:
name: Basic Test
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest TODO(jason): Enable when we install in the correct location.
- windows-latest
runs-on: ${{ matrix.os }}

steps:
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Setup `chainctl`

[![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)

This action installs the latest `chainctl` binary for a particular environment
and authenticates with it using identity tokens.

Expand All @@ -25,3 +27,9 @@ steps:
```

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`.

# Runner Support

The action is tested to work on Linux, MacOS and Windows runners.

Note: If you use it on Windows, you must use `shell: bash`.
8 changes: 5 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ runs:
fi

url="https://dl.${{ inputs.environment }}/chainctl/latest/chainctl_${os}_${arch}"
out="chainctl"
if [[ "${os}" == "windows" ]]; then
url="${url}.exe"
out="${out}.exe"
fi
echo "Downloading chainctl from ${url}"

curl -o ./chainctl -fsL "${url}"
chmod +x ./chainctl
mv ./chainctl /usr/local/bin
curl -o ./${out} -fsL "${url}"
chmod +x ./${out}
echo "$(pwd)" >> $GITHUB_PATH

- name: Authenticate with Chainguard (assumed identity)
shell: bash
Expand Down