|
1 | 1 | name: setup-agentplane |
2 | | -description: Install and verify the AgentPlane CLI in GitHub Actions. |
3 | | -author: 'Basilisk Labs' |
4 | | -branding: |
5 | | - icon: terminal |
6 | | - color: purple |
7 | | -permissions: |
8 | | - contents: read |
| 2 | +description: Install the AgentPlane CLI in GitHub Actions. |
9 | 3 | inputs: |
10 | 4 | version: |
11 | | - description: AgentPlane version to install. Use a plain semver value such as 0.4.1. |
| 5 | + description: AgentPlane version to install. Use a plain semver value such as 0.4.2. |
12 | 6 | required: false |
13 | | - default: '0.4.1' |
| 7 | + default: "0.4.2" |
14 | 8 | verify: |
15 | 9 | description: Run an agentplane --version smoke check after installation. |
16 | 10 | required: false |
17 | | - default: 'true' |
| 11 | + default: "true" |
18 | 12 | runs: |
19 | 13 | using: composite |
20 | 14 | steps: |
21 | 15 | - name: Install AgentPlane |
22 | 16 | shell: bash |
23 | 17 | run: | |
24 | 18 | set -euo pipefail |
25 | | - version="${{ inputs.version }}" |
| 19 | + version="${inputs.version}" |
26 | 20 | version="${version#v}" |
27 | | - tag="v${version}" |
28 | | - repo="basilisk-labs/agentplane" |
29 | 21 | tmp_dir="$(mktemp -d)" |
30 | 22 | trap 'rm -rf "$tmp_dir"' EXIT INT TERM |
31 | | -
|
32 | | - case "$RUNNER_OS-$RUNNER_ARCH" in |
| 23 | + case "${RUNNER_OS}-${RUNNER_ARCH}" in |
33 | 24 | macOS-ARM64) |
34 | | - asset_url="https://github.com/${repo}/releases/download/${tag}/agentplane-${tag}-darwin-arm64.tar.gz" |
| 25 | + asset_url="https://github.com/basilisk-labs/agentplane/releases/download/v0.4.2/agentplane-v0.4.2-darwin-arm64.tar.gz" |
| 26 | + asset_sha256="8bc19b2a29a48a350d283153156644e8128cd05e49cd1a02513659a5aa95759b" |
35 | 27 | ;; |
36 | 28 | macOS-X64) |
37 | | - asset_url="https://github.com/${repo}/releases/download/${tag}/agentplane-${tag}-darwin-x64.tar.gz" |
| 29 | + asset_url="https://github.com/basilisk-labs/agentplane/releases/download/v0.4.2/agentplane-v0.4.2-darwin-x64.tar.gz" |
| 30 | + asset_sha256="a538cc7d91ff55fbf2c1dbc969782500d8a5c5ed1e0b9a50e2530616957f2083" |
38 | 31 | ;; |
39 | 32 | Linux-ARM64) |
40 | | - asset_url="https://github.com/${repo}/releases/download/${tag}/agentplane-${tag}-linux-arm64.tar.gz" |
| 33 | + asset_url="https://github.com/basilisk-labs/agentplane/releases/download/v0.4.2/agentplane-v0.4.2-linux-arm64.tar.gz" |
| 34 | + asset_sha256="ea322de9be2b17142f1401da550a94f2bb90ee875638d6421a509c2f00b5fa46" |
41 | 35 | ;; |
42 | 36 | Linux-X64) |
43 | | - asset_url="https://github.com/${repo}/releases/download/${tag}/agentplane-${tag}-linux-x64.tar.gz" |
| 37 | + asset_url="https://github.com/basilisk-labs/agentplane/releases/download/v0.4.2/agentplane-v0.4.2-linux-x64.tar.gz" |
| 38 | + asset_sha256="0482e411160f07ee703d75efa35d9e520a6a22cf9c3fac95025381b5d70a7c09" |
44 | 39 | ;; |
45 | 40 | Windows-X64) |
46 | | - asset_url="https://github.com/${repo}/releases/download/${tag}/agentplane-${tag}-win32-x64.zip" |
| 41 | + asset_url="https://github.com/basilisk-labs/agentplane/releases/download/v0.4.2/agentplane-v0.4.2-win32-x64.zip" |
| 42 | + asset_sha256="2050625d6c9032020decc1805c02d9f25a4a9b8b5ec3434a12bbaa37532df5cd" |
47 | 43 | ;; |
48 | 44 | *) |
49 | 45 | echo "Unsupported runner: ${RUNNER_OS}-${RUNNER_ARCH}" >&2 |
50 | 46 | exit 2 |
51 | 47 | ;; |
52 | 48 | esac |
53 | | -
|
54 | | - archive="$tmp_dir/asset" |
55 | | - asset_name="${asset_url##*/}" |
56 | | - install_dir="$tmp_dir/agentplane" |
57 | | - mkdir -p "$install_dir" |
58 | | - curl -fsSL --retry 3 --retry-all-errors "${asset_url}" -o "${archive}" |
59 | | - sums_url="https://github.com/${repo}/releases/download/${tag}/SHA256SUMS" |
60 | | - expected_sha="$(curl -fsSL --retry 3 --retry-all-errors "${sums_url}" | awk -v name="$asset_name" '$2 == name { print $1 }')" |
61 | | - actual_sha="$(sha256sum "${archive}" | awk '{print $1}')" |
62 | | - if [ -n "${expected_sha}" ] && [ "${actual_sha}" != "${expected_sha}" ]; then |
63 | | - echo "Checksum mismatch for ${asset_name}" >&2 |
| 49 | + archive="${tmp_dir}/${asset_url##*/}" |
| 50 | + install_dir="${tmp_dir}/agentplane" |
| 51 | + mkdir -p "${install_dir}" |
| 52 | + curl -fsSL "${asset_url}" -o "${archive}" |
| 53 | + actual_sha256="$(shasum -a 256 "${archive}" | awk '{print $1}')" |
| 54 | + if [ "${actual_sha256}" != "${asset_sha256}" ]; then |
| 55 | + echo "agentplane archive checksum mismatch" >&2 |
64 | 56 | exit 2 |
65 | 57 | fi |
66 | | - if [[ "$archive" == *.zip ]]; then |
| 58 | + if [[ "${archive}" == *.zip ]]; then |
67 | 59 | powershell -NoProfile -Command "Expand-Archive -LiteralPath '${archive}' -DestinationPath '${install_dir}' -Force" |
68 | 60 | else |
69 | | - tar -xzf "$archive" -C "$install_dir" |
| 61 | + tar -xzf "${archive}" -C "${install_dir}" |
70 | 62 | fi |
71 | | - echo "$install_dir/bin" >> "$GITHUB_PATH" |
| 63 | + echo "${install_dir}/bin" >> "$GITHUB_PATH" |
72 | 64 | if [ "${{ inputs.verify }}" = "true" ]; then |
73 | | - "$install_dir/bin/agentplane" --version | grep -Fx "$version" |
| 65 | + "${install_dir}/bin/agentplane" --version | grep -Fx "${version}" |
74 | 66 | fi |
0 commit comments