The scratch runtime stage copies an explicit /tmp: restore extracts an archive there before verifying it, and a scratch image has none. shared/ now fans out to four Go images rather than three.
61 lines
2.0 KiB
YAML
61 lines
2.0 KiB
YAML
name: vantagectl Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "vantagectl/v*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-docker
|
|
container: node:26
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.26"
|
|
cache: true
|
|
cache-dependency-path: vantagectl/go.sum
|
|
|
|
- name: Extract version
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#vantagectl/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Test
|
|
working-directory: vantagectl
|
|
run: go test ./...
|
|
|
|
- name: Build
|
|
working-directory: vantagectl
|
|
env:
|
|
VERSION: ${{ steps.version.outputs.VERSION }}
|
|
run: |
|
|
mkdir -p dist
|
|
for target in linux/amd64 linux/arm64 darwin/arm64 windows/amd64; do
|
|
goos="${target%/*}"
|
|
goarch="${target#*/}"
|
|
out="dist/vantagectl-${goos}-${goarch}"
|
|
if [ "$goos" = "windows" ]; then out="${out}.exe"; fi
|
|
CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build \
|
|
-ldflags="-s -w -X main.Version=${VERSION}" \
|
|
-o "$out" .
|
|
done
|
|
|
|
- name: Checksums
|
|
working-directory: vantagectl/dist
|
|
run: sha256sum vantagectl-* > checksums.txt
|
|
|
|
- name: Create release
|
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
|
with:
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
files: |
|
|
vantagectl/dist/vantagectl-linux-amd64
|
|
vantagectl/dist/vantagectl-linux-arm64
|
|
vantagectl/dist/vantagectl-darwin-arm64
|
|
vantagectl/dist/vantagectl-windows-amd64.exe
|
|
vantagectl/dist/checksums.txt
|