Update the action to include an optional bindir

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
pull/2281/head
Gergely Brautigam 3 years ago
parent 5cab8f4b11
commit 759145704f
No known key found for this signature in database
GPG Key ID: 3ADEA986CA5BCBF1

@ -12,6 +12,9 @@ inputs:
description: "arch can be amd64, arm64 or arm" description: "arch can be amd64, arm64 or arm"
required: true required: true
default: "amd64" default: "amd64"
bindir:
description: "Optional location of the Flux binary. Will not use sudo if set. Updates System Path."
required: false
runs: runs:
using: composite using: composite
steps: steps:
@ -29,10 +32,16 @@ runs:
curl -sL ${BIN_URL} -o /tmp/flux.tar.gz curl -sL ${BIN_URL} -o /tmp/flux.tar.gz
mkdir -p /tmp/flux mkdir -p /tmp/flux
tar -C /tmp/flux/ -zxvf /tmp/flux.tar.gz tar -C /tmp/flux/ -zxvf /tmp/flux.tar.gz
- name: "Add flux binary to /usr/local/bin" - name: "Copy Flux binary to execute location"
shell: bash shell: bash
run: | run: |
BINDIR=${{ inputs.bindir }}
if [ -z $BINDIR ]; then
sudo cp /tmp/flux/flux /usr/local/bin sudo cp /tmp/flux/flux /usr/local/bin
else
cp /tmp/flux/flux "${BINDIR}"
echo "${BINDIR}" >> $GITHUB_PATH
fi
- name: "Cleanup tmp" - name: "Cleanup tmp"
shell: bash shell: bash
run: | run: |

Loading…
Cancel
Save