better-setup-go v1: pinned static Go, musl-safe
This commit is contained in:
@@ -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
@@ -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
|
||||||
Reference in New Issue
Block a user