Skip to content

Commit

Permalink
Merge pull request #426 from fujiwara/v1-actions-test
Browse files Browse the repository at this point in the history
V1 actions test
  • Loading branch information
fujiwara authored Aug 9, 2024
2 parents 17ed29b + 2935b27 commit 47d5088
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`.
Expand Down
30 changes: 21 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
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"
description: "A version to install lambroll"
default: "v1.0.5"
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 47d5088

Please sign in to comment.