Skip to content

Commit 5ff5fe8

Browse files
fix: update binary name mapping
1 parent 3d4327a commit 5ff5fe8

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

.github/actions/setup-componentize-go/action.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,35 @@ runs:
1111
using: 'composite'
1212
steps:
1313
- name: Cache componentize-go
14+
id: cache
1415
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # 5.0.4
1516
with:
16-
path: |
17-
${{ runner.tool_cache }}/componentize-go/${{ inputs.version }}
17+
path: ${{ runner.tool_cache }}/componentize-go/${{ inputs.version }}
1818
key: componentize-go-${{ runner.os }}-${{ runner.arch }}-${{ inputs.version }}
19+
1920
- name: Download componentize-go
21+
if: steps.cache.outputs.cache-hit != 'true'
2022
shell: bash
2123
run: |
22-
bin_name="componentize-go-${{ runner.os }}-${{ runner.arch }}"
24+
case "${{ runner.os }}-${{ runner.arch }}" in
25+
Linux-X64) os="linux"; arch="amd64" ;;
26+
Linux-ARM64) os="linux"; arch="arm64" ;;
27+
macOS-X64) os="darwin"; arch="amd64" ;;
28+
macOS-ARM64) os="darwin"; arch="arm64" ;;
29+
Windows-X64) os="windows"; arch="amd64" ;;
30+
*) echo "Unsupported platform: ${{ runner.os }}-${{ runner.arch }}"; exit 1 ;;
31+
esac
2332
24-
# Download release
25-
curl -LO https://github.com/bytecodealliance/componentize-go/releases/download/${{ inputs.version }}/${bin_name}.tar.gz
26-
tar -xvzf ${bin_name}.tar.gz
33+
archive="componentize-go-${os}-${arch}.tar.gz"
34+
curl -fsSL "https://github.com/bytecodealliance/componentize-go/releases/download/${{ inputs.version }}/${archive}" \
35+
-o "${archive}"
36+
tar -xzf "${archive}"
2737
28-
# Add to cache
2938
cache_dir="${{ runner.tool_cache }}/componentize-go/${{ inputs.version }}"
3039
mkdir -p "${cache_dir}"
31-
cp componentize-go "${cache_dir}"
32-
chmod +x "${cache_dir}/componentize-go"
40+
cp componentize-go "${cache_dir}/"
41+
chmod +x "${cache_dir}/componentize-go"
42+
43+
- name: Add componentize-go to PATH
44+
shell: bash
45+
run: echo "${{ runner.tool_cache }}/componentize-go/${{ inputs.version }}" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)