Skip to content

Commit

Permalink
GitHub Action to install TGF
Browse files Browse the repository at this point in the history
  • Loading branch information
jonapich committed Jul 12, 2024
1 parent 307c4ee commit ecfa860
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
posix:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
Expand All @@ -17,9 +18,30 @@ jobs:
- uses: actions/checkout@v4
- run: ./get-latest-tgf.sh


windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- run: ./get-latest-tgf.ps1


action:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: ./
with:
ref: ${{ github.head_ref }}

- run: tgf --help-tgf
if: runner.os != 'Windows'

- run: ./tgf --help-tgf
if: runner.os == 'Windows'
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ outdated version.

## Installation

### GitHub Action

You can install `TGF` using the provided GitHub Action:

```
steps:
- uses: coveooss/tgf@master
```

### Manual installation

On `mac` and `linux`:

You can run the `get-latest-tgf.sh` script to check if you have the latest version of tgf installed and install it as needed:
Expand Down
32 changes: 32 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Install TGF
description: GitHub Action to install https://github.com/coveooss/tgf

inputs:
tgf-path:
description: Installs the TGF binary to this folder. The folder will not be added to the PATH.
required: false
ref:
description: The ref to use to run the install script.
default: ${{ github.action_ref }}
required: false


runs:
using: "composite"
steps:
- name: Install TGF (posix)
if: runner.os != 'Windows'
shell: bash
env:
TGF_PATH: ${{ inputs.tgf-path }}
VERSION: ${{ inputs.ref }}
run: curl "https://raw.githubusercontent.com/coveooss/tgf/${VERSION}/get-latest-tgf.sh" | bash

- name: Install TGF (windows)
if: runner.os == 'Windows'
shell: pwsh
env:
TGF_PATH: ${{ inputs.tgf-path }}
VERSION: ${{ inputs.ref }}
run: |
(Invoke-WebRequest https://raw.githubusercontent.com/coveooss/tgf/${env:VERSION}/get-latest-tgf.ps1).Content | Invoke-Expression

0 comments on commit ecfa860

Please sign in to comment.