31 lines
889 B
YAML
31 lines
889 B
YAML
|
|
name: 'Tinqs Setup Go'
|
||
|
|
description: 'Install Go and configure PATH (replaces actions/setup-go)'
|
||
|
|
|
||
|
|
inputs:
|
||
|
|
go-version:
|
||
|
|
description: 'Go version to install'
|
||
|
|
default: '1.26.2'
|
||
|
|
|
||
|
|
runs:
|
||
|
|
using: 'composite'
|
||
|
|
steps:
|
||
|
|
- run: |
|
||
|
|
GO_VERSION="${{ inputs.go-version }}"
|
||
|
|
|
||
|
|
# Skip if already installed at correct version
|
||
|
|
if command -v go &>/dev/null; then
|
||
|
|
CURRENT=$(go version | grep -oP '\d+\.\d+\.\d+' || true)
|
||
|
|
if [ "$CURRENT" = "$GO_VERSION" ]; then
|
||
|
|
echo "Go $GO_VERSION already installed"
|
||
|
|
go version
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "Installing Go $GO_VERSION..."
|
||
|
|
curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xz
|
||
|
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
||
|
|
export PATH="/usr/local/go/bin:$PATH"
|
||
|
|
go version
|
||
|
|
shell: bash
|