-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
27 lines (27 loc) · 1.03 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
name: 'Install magefile/mage'
description: 'A composite run steps action to install magefile/mage'
inputs:
mage-version:
description: 'Set a mage version, e.g. 1.13.0'
default: ''
required: false
runs:
using: "composite"
steps:
- name: Install magefile/mage
run: |
# set -eux
echo "https://github.com/peaceiris/workflows/blob/main/setup-mage/action.yml"
if [ -z '${{ inputs.mage-version }}' ]; then
export MAGE_VERSION="$(curl -fsi "https://github.com/magefile/mage/releases/latest" | awk -F/ '/^(L|l)ocation:/ {print $(NF)}' | tr -d '\r')"
else
export MAGE_VERSION="${{ inputs.mage-version }}"
fi
export MAGE_VERSION="${MAGE_VERSION#v}"
cd $(mktemp --directory)
wget --quiet https://github.com/magefile/mage/releases/download/v${MAGE_VERSION}/mage_${MAGE_VERSION}_Linux-64bit.tar.gz
tar xvf "mage_${MAGE_VERSION}_Linux-64bit.tar.gz"
sudo cp ./mage /usr/local/bin/mage
shell: bash
- run: mage --version
shell: bash