Skip to content

Commit

Permalink
Add GitHub Action for installing stellar-cli in repos (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Oct 14, 2024
1 parent 9cc8fcd commit d538ea9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'Install stellar-cli'
description: 'Install the stellar-cli'
inputs:
version:
description: |
Recommended for use only in testing new versions of the action prior to
release. For regular use, use the version of the action corresponding to
the version of the stellar-cli that should be installed.
required: false
runs:
using: "composite"
steps:
- name: Setup install path
shell: bash
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Copy binary to install location
shell: bash
env:
REF: ${{ github.action_ref }}
run: |
version="${{ inputs.version || env.REF }}"
case "${{ runner.os }}-${{ runner.arch }}" in
'Linux-X64')
os_arch=x86_64-unknown-linux-gnu
;;
'Linux-ARM64')
os_arch=aarch64-unknown-linux-gnu
;;
'macOS-X64')
os_arch=x86_64-apple-darwin
;;
'macOS-ARM64')
os_arch=aarch64-apple-darwin
;;
'Windows-X64')
os_arch=x86_64-pc-windows-msvc
;;
*)
echo "Unsupported OS / Arch pair: ${{ runner.os }} ${{ runner.arch }}" >&2
exit 1
esac
file="stellar-cli-$version-$os_arch.tar.gz"
url="https://github.com/stellar/stellar-cli/releases/download/v$version/$file"
echo "$url"
curl -fL "$url" | tar xvz -C $HOME/.local/bin

0 comments on commit d538ea9

Please sign in to comment.