-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Action for installing stellar-cli in repos (#1669)
- Loading branch information
1 parent
9cc8fcd
commit d538ea9
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |