diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..9c94d20 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,21 @@ +name: Check + +on: + push: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: + - 0.8.0 + - 0.8.3 + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + version: ${{ matrix.version }} + - run: test "$(intlc --version)" = v${{ matrix.version }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dec711b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM alpine:3.20 + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +RUN apk add --no-cache curl + +COPY ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d8e813a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Unsplash + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a4bc2d5 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# intlc-action + +A GitHub Action providing CLI access to [intlc](https://github.com/unsplash/intlc). Currently supports only x86_64. + +## Usage + +Specify any version >=0.8.0: + +```yml +steps: + - uses: unsplash/intlc-action@v1 + with: + version: 0.8.3 + - run: intlc --version +``` diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e6d2213 --- /dev/null +++ b/action.yml @@ -0,0 +1,12 @@ +name: Install intlc +description: Installs intlc to $PATH + +inputs: + version: + required: true + +runs: + using: docker + image: ./Dockerfile + args: + - ${{ inputs.version }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..f646eef --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +VERSION="$1" +shift + +curl -sL "https://github.com/unsplash/intlc/releases/download/v$VERSION/intlc-v$VERSION-linux-x86_64" -o /usr/local/bin/intlc +chmod +x /usr/local/bin/intlc + +stat /usr/local/bin/intlc +file /usr/local/bin/intlc +/usr/local/bin/intlc --version + +PATH="/usr/local/bin:$PATH" + +intlc --version + +exec "$@"