From 699b0a0d7d729108a500ed2e872f89f538dd7cd2 Mon Sep 17 00:00:00 2001 From: "Sam A. Horvath-Hunt" Date: Wed, 24 Jul 2024 10:02:17 +0100 Subject: [PATCH] WIP: Initial --- .github/workflows/check.yml | 21 +++++++++++++++++++++ Dockerfile | 11 +++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 15 +++++++++++++++ action.yml | 12 ++++++++++++ entrypoint.sh | 16 ++++++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 .github/workflows/check.yml create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 action.yml create mode 100644 entrypoint.sh 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..c537acb --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,16 @@ +#!/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 + +PATH="/usr/local/bin:$PATH" + +/usr/local/bin/intlc --version +intlc --version + +exec "$@"