From 2563fe94e2071f9fdf6de27e2719a79062855c7f Mon Sep 17 00:00:00 2001 From: ume Date: Wed, 17 Jul 2024 17:21:21 +0900 Subject: [PATCH 1/2] feat(action.yml): auto detect os and arch --- action.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index 90b5460..e157fa0 100644 --- a/action.yml +++ b/action.yml @@ -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 From 2935b27b9a6f9bf8cdd276da24109e0403f55012 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Sat, 10 Aug 2024 00:07:25 +0900 Subject: [PATCH 2/2] fix readme for actions --- README.md | 9 ++++++--- action.yml | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9ab165a..ba5fd0b 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ jobs: ### GitHub Actions -Action fujiwara/lambroll@v0 installs lambroll binary for Linux into /usr/local/bin. This action runs install only. +Action fujiwara/lambroll@v1 installs lambroll binary for Linux into /usr/local/bin. This action runs install only. ```yml jobs: @@ -82,12 +82,15 @@ jobs: - uses: fujiwara/lambroll@v1 with: version: v1.0.4 - os: linux # linux or darwin (default: linux) - arch: amd64 # amd64 or arm64 (default: amd64) - run: | lambroll deploy ``` +Note: +- `version` is not required, but it is recommended that the version be specified. + - The default version is not fixed and may change in the future. +- `os` and `arch` are automatically detected. (Some previous versions use `os` and `arch` as inputs, but they are deprecated.) + ## Quick start Try migrate your existing Lambda function `hello`. diff --git a/action.yml b/action.yml index e157fa0..8a18ff2 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ inputs: version: - description: "A version to install lamroll" - default: "v1.0.1" + description: "A version to install lambroll" + default: "v1.0.5" runs: using: "composite" steps: