From 866ad1b6b01368d5e72843da659fe8543495c2c6 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Sat, 27 Jan 2024 00:49:20 +0900 Subject: [PATCH] v1 action and orb --- action.yml | 8 ++++---- circleci-orb.yml | 26 +++++++------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/action.yml b/action.yml index da09d60..5660254 100644 --- a/action.yml +++ b/action.yml @@ -1,13 +1,13 @@ inputs: version: description: "A version to install lamroll" - default: "v0.10.0" + default: "v1.0.0" runs: using: "composite" steps: - run: | - cd /tmp + 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}}_linux_amd64.tar.gz | tar zxvf - - sudo install lambroll_${{ inputs.version }}_linux_amd64/lambroll /usr/local/bin - rm -rf lambroll_${{ inputs.version }}_linux_amd64/ + sudo install lambroll /usr/local/bin shell: bash diff --git a/circleci-orb.yml b/circleci-orb.yml index 79b2251..30b695b 100644 --- a/circleci-orb.yml +++ b/circleci-orb.yml @@ -12,32 +12,20 @@ commands: version: description: lambroll version type: string - default: v0.10.0 + default: v1.0.0 steps: - detect/init - run: name: "Install lambroll" command: | - case $OSD_FAMILY in - linux) - PKG_EXT=tar.gz - EXTRACT="tar zxvf" - ;; - darwin) - PKG_EXT=zip - EXTRACT="unzip" - ;; - *) - echo "Unsupported operating system. $OSD_FAMILY" - exit 1 - ;; - esac + mkdir -p /tmp/lambroll-<< parameters.version >> + cd /tmp/lambroll-<< parameters.version >> DIRNAME=lambroll_<< parameters.version >>_${OSD_FAMILY}_amd64 - FILENAME=${DIRNAME}.${PKG_EXT} + FILENAME=${DIRNAME}.tar.gz LAMBROLL_URL=https://github.com/fujiwara/lambroll/releases/download/<< parameters.version >>/${FILENAME} - curl -L $LAMBROLL_URL > /tmp/${FILENAME} - $EXTRACT /tmp/${FILENAME} - sudo install ${DIRNAME}/lambroll /usr/local/bin + curl -L $LAMBROLL_URL ${FILENAME} + tar zxvf ${FILENAME} + sudo install lambroll /usr/local/bin examples: install_lambroll: