diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7436da4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: CI + +on: [push] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Get Ninja + id: ninja + uses: ./ # Uses an action in the root directory + + - name: Did we get Ninja? + run: echo "Ninja version was '${{ steps.ninja.outputs.version }}'" diff --git a/README.md b/README.md new file mode 100644 index 0000000..f624ae7 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Get Ninja GitHub Action + +Gets the most recent Ninja + +**Works on**: Linux, Windows and MacOS + +## Inputs + +No inputs + +## Outputs + +### `version` + +The version string from "ninja --version" + +## Example usage + +~~~~ + - name: Install Ninja + id: ninja + uses: turtlesec-no/get-ninja@main + + - name: Ninja version + run: echo "${{ steps.ninja.outputs.version }}" +~~~~ diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e0b661b --- /dev/null +++ b/action.yml @@ -0,0 +1,28 @@ +name: 'Get Ninja' +description: 'Installs Ninja' +author: 'TurtleSec' +outputs: + version: + description: "The version of Ninja which was installed" + value: ${{ steps.output_version.outputs.version }} +runs: + using: "composite" + steps: + - name: Install on Mac/Linux/Windows + run: | + pip3 install wheel setuptools + pip3 install ninja --upgrade + shell: bash + - name: Fix path on Linux + run: | + echo "/home/runner/.local/bin" >> $GITHUB_PATH + shell: bash + - name: Fill in output variable + id: output_version + shell: bash + run: | + ninja --version + echo "::set-output name=version::$(ninja --version)" +branding: + icon: "archive" + color: "green"