better-setup-go v1: pinned static Go, musl-safe

This commit is contained in:
2026-10-31 08:51:20 +02:00
commit 715ab79600
2 changed files with 32 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# better-setup-go
Fork of the setup-go recipe for git.madapes.com runners: installs the **pinned** Go from the
official static tarball. No versions-manifest round-trip, no glibc runtime requirement —
works on musl runner images where nothing needs installing first.
```yaml
- uses: https://git.madapes.com/actions/better-setup-go@v1
with: { go-version: "1.27.0" }
```
+22
View File
@@ -0,0 +1,22 @@
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