-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
action.yml
44 lines (42 loc) · 1.47 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
inputs:
version:
description: "A version to install lambroll"
default: "v1.0.5"
required: false
version-file:
description: "File name that contains the lambroll version."
required: false
runs:
using: "composite"
steps:
- name: Set lambroll version
id: set-lambroll-version
run: |
VERSION=${{ inputs.version }}
if [ -n "${{ inputs.version-file }}" ]; then
VERSION=v$(cat ${{ inputs.version-file }})
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
shell: bash
- name: Set file name
id: set-filename
run: |
case "${{ runner.os }}" in
Linux) BIN_OS="linux" ;;
macOS) BIN_OS="darwin" ;;
*) BIN_OS="linux" ;;
esac
case "${{ runner.arch }}" in
X64) BIN_ARCH="amd64" ;;
ARM64) BIN_ARCH="arm64" ;;
*) BIN_ARCH="amd64" ;;
esac
FILENAME=lambroll_${{ steps.set-lambroll-version.outputs.VERSION }}_${BIN_OS}_${BIN_ARCH}.tar.gz
echo "FILENAME=$FILENAME" >> $GITHUB_OUTPUT
shell: bash
- run: |
mkdir -p /tmp/lambroll-${{ steps.set-lambroll-version.outputs.VERSION }}
cd /tmp/lambroll-${{ steps.set-lambroll-version.outputs.VERSION }}
curl -sL https://github.com/fujiwara/lambroll/releases/download/${{ steps.set-lambroll-version.outputs.VERSION }}/${{ steps.set-filename.outputs.FILENAME }} | tar zxvf -
sudo install lambroll /usr/local/bin
shell: bash