Skip to content

Commit

Permalink
Merge pull request #417 from bungoume/patch-1
Browse files Browse the repository at this point in the history
feat(action.yml): auto detect os and arch
  • Loading branch information
fujiwara authored Aug 9, 2024
2 parents 17ed29b + 2563fe9 commit 4bf9d77
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -2,18 +2,30 @@ inputs:
version:
description: "A version to install lamroll"
default: "v1.0.1"
os:
description: "operating system. possible values: linux, darwin"
default: "linux"
arch:
description: "architecture. possible values: amd64, arm64"
default: "amd64"
runs:
using: "composite"
steps:
- name: Set file name
id: set-filename
run: |
BIN_OS=$(case "${{ runner.os }}" in
Linux) echo "linux" ;;
macOS) echo "darwin" ;;
*) echo "linux" ;;
esac)
BIN_ARCH=$(case "${{ runner.arch }}" in
X64) echo "amd64" ;;
ARM64) echo "arm64" ;;
*) echo "amd64" ;;
esac)
FILENAME=lambroll_${{ inputs.version }}_${BIN_OS}_${BIN_ARCH}.tar.gz
echo "FILENAME=$FILENAME" >> $GITHUB_OUTPUT
shell: bash
- run: |
mkdir -p /tmp/lambroll-${{ inputs.version }}
cd /tmp/lambroll-${{ inputs.version }}
curl -sL https://github.com/fujiwara/lambroll/releases/download/${{ inputs.version }}/lambroll_${{ inputs.version }}_${{ inputs.os }}_${{ inputs.arch }}.tar.gz | tar zxvf -
curl -sL https://github.com/fujiwara/lambroll/releases/download/${{ inputs.version }}/${{ steps.set-filename.outputs.FILENAME }} | tar zxvf -
sudo install lambroll /usr/local/bin
shell: bash

0 comments on commit 4bf9d77

Please sign in to comment.