23 lines
813 B
YAML
23 lines
813 B
YAML
name: better-setup-go
|
|
description: Install a pinned Go toolchain from the official static tarball — musl-safe, no manifest fetches, Forgejo/act runner safe.
|
|
inputs:
|
|
go-version:
|
|
description: Exact Go version to install (e.g. 1.27.0).
|
|
required: true
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
v="${{ inputs.go-version }}"
|
|
case "$(uname -m)" in
|
|
x86_64|amd64) arch=amd64 ;;
|
|
aarch64|arm64) arch=arm64 ;;
|
|
*) echo "better-setup-go: unsupported arch $(uname -m)" >&2; exit 1 ;;
|
|
esac
|
|
curl -fsSL "https://go.dev/dl/go${v}.linux-${arch}.tar.gz" | tar -xz -C /usr/local
|
|
ln -sf /usr/local/go/bin/go /usr/local/bin/go
|
|
ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt
|
|
go version
|