Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/github.com/docker/do…
Browse files Browse the repository at this point in the history
…cker-25.0.5incompatible
  • Loading branch information
jocgir authored Oct 3, 2024
2 parents db52ba4 + 49f33e4 commit ec5e5d5
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 22 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.22

- uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -37,9 +37,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.22

- uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
with:
distribution: goreleaser
version: latest
Expand All @@ -53,17 +53,17 @@ jobs:
fetch-depth: 0 # goreleaser needs the whole history to build the release notes
- uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.22

- uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean
env:
CGO_ENABLED: 0

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: test-release
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.22
- uses: actions/checkout@v4
with:
fetch-depth: 0 # goreleaser needs the whole history to build the release notes

- uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
with:
distribution: goreleaser
version: latest
Expand Down
18 changes: 18 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,26 @@ 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
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
34 changes: 34 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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, but the defaults are typically already in the path.
required: false
default: ${{ runner.os == 'Windows' && '${env:LocalAppData}\Microsoft\WindowsApps' || '/usr/local/bin' }}
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
8 changes: 6 additions & 2 deletions get-latest-tgf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ $ZipFile = "tgf.zip"
$TempTgfFolder = "tgf_unzipped"
$TempTgfPath = Join-Path -Path $TempTgfFolder -ChildPath "tgf.exe"

Write-Host "Installing tgf v$($LATEST_VERSION) in the current directory ($(Get-Location)) ..."
Write-Host "Installing: tgf v$($LATEST_VERSION)"
Invoke-WebRequest "https://github.com/coveo/tgf/releases/download/v$($LATEST_VERSION)/tgf_$($LATEST_VERSION)_windows_64-bits.zip" -OutFile $ZipFile
Expand-Archive -Path $ZipFile -DestinationPath $TempTgfFolder
Copy-Item $TempTgfPath -Destination $TGF_PATH -Force

$Destination = if ([string]::IsNullOrWhiteSpace(${env:TGF_PATH})) { "." } else { $ExecutionContext.InvokeCommand.ExpandString(${env:TGF_PATH}) }
Write-Host "Copying executable to $($Destination)"
Copy-Item $TempTgfPath -Destination $Destination -Force

Write-Host "Cleaning up..."
Remove-Item $ZipFile
Remove-Item $TempTgfFolder -Recurse
Write-Host "Installation is completed!"
Expand Down
4 changes: 2 additions & 2 deletions get-latest-tgf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ install_latest_tgf () {
LINUX_ARCH=$(uname -m)
echo 'Installing latest tgf for Linux with arch '$LINUX_ARCH' in' $TGF_PATH '...'
DOWNLOAD_URL=$([ "$LINUX_ARCH" == "x86_64" ] && echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_linux_64-bits.zip" || echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_linux_arm64.zip")
curl -sL $DOWNLOAD_URL | gzip -d > ${TGF} && chmod +x ${TGF} && script_end
curl -sL $DOWNLOAD_URL | gzip -d > ${TGF} && chmod 0755 ${TGF} && script_end
elif [[ $(uname -s) == Darwin ]]
then
OSX_ARCH=$(uname -m)
echo 'Installing latest tgf for OSX with arch '$OSX_ARCH' in' $TGF_PATH '...'
DOWNLOAD_URL=$([ "$OSX_ARCH" == "arm64" ] && echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_macOS_arm64.zip" || echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_macOS_64-bits.zip")
curl -sL $DOWNLOAD_URL | bsdtar -xf- -C ${TGF_PATH} && chmod +x ${TGF} && script_end
curl -sL $DOWNLOAD_URL | bsdtar -xf- -C ${TGF_PATH} && chmod 0755 ${TGF} && script_end
else
echo 'OS not supported.'
exit 1
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/coveooss/tgf

go 1.21
go 1.22

require (
github.com/aws/aws-sdk-go-v2 v1.25.2
Expand All @@ -15,9 +15,9 @@ require (
github.com/coveooss/gotemplate/v3 v3.7.5
github.com/coveooss/multilogger v0.5.2
github.com/coveord/kingpin/v2 v2.4.2
github.com/docker/docker v25.0.5+incompatible
github.com/docker/docker v25.0.6+incompatible
github.com/fatih/color v1.16.0
github.com/hashicorp/go-getter v1.7.3
github.com/hashicorp/go-getter v1.7.5
github.com/minio/selfupdate v0.6.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -105,7 +105,7 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE=
github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg=
github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -446,8 +446,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E=
github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744=
github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4=
github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
Expand Down Expand Up @@ -712,8 +712,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down

0 comments on commit ec5e5d5

Please sign in to comment.