-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathaction.yml
30 lines (27 loc) · 1.4 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: "Install Shuttle"
description: "Installs Lunar Shuttle"
runs:
using: "composite"
steps:
- run: |
set -e
if [ "$(uname)" == "Darwin" ]; then
mkdir -p ~/bin
if [[ $(uname -m) == 'arm64' ]]; then
curl -LO https://github.com/lunarway/shuttle/releases/download/$(curl -Lso /dev/null -w %{url_effective} https://github.com/lunarway/shuttle/releases/latest | awk -F'/' '{print $NF}')/shuttle-darwin-arm64
chmod +x shuttle-darwin-arm64
mv shuttle-darwin-arm64 ~/bin/shuttle
else
curl -LO https://github.com/lunarway/shuttle/releases/download/$(curl -Lso /dev/null -w %{url_effective} https://github.com/lunarway/shuttle/releases/latest | awk -F'/' '{print $NF}')/shuttle-darwin-amd64
chmod +x shuttle-darwin-amd64
mv shuttle-darwin-amd64 ~/bin/shuttle
fi
echo "~/bin/" >> $GITHUB_PATH
export PATH=$PATH:~/bin
shuttle version
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
curl -LO https://github.com/lunarway/shuttle/releases/download/$(curl -Lso /dev/null -w %{url_effective} https://github.com/lunarway/shuttle/releases/latest | grep -o '[^/]*$')/shuttle-linux-amd64
chmod +x shuttle-linux-amd64
mv shuttle-linux-amd64 /usr/local/bin/shuttle
fi
shell: bash