39 lines
967 B
YAML
39 lines
967 B
YAML
name: release
|
|||
|
|
|
||
|
|
on:
|
||
|
|
push:
|
||
|
|
tags:
|
||
|
|
- 'v*'
|
||
|
|
|
||
|
|
jobs:
|
||
|
|
build:
|
||
|
|
runs-on: docker
|
||
|
|
container:
|
||
|
|
image: golang:1.25
|
||
|
|
env:
|
||
|
|
GOPRIVATE: forgejo.riotpiao.homelab.com
|
||
|
|
steps:
|
||
|
|
- uses: actions/checkout@v4
|
||
|
|
|
||
|
|
- name: build cross-platform binaries
|
||
|
|
run: |
|
||
|
|
mkdir -p dist
|
||
|
|
VERSION="${GITHUB_REF_NAME}"
|
||
|
|
for os in linux darwin; do
|
||
|
|
for arch in amd64 arm64; do
|
||
|
|
out="dist/kmsvc-${os}-${arch}"
|
||
|
|
GOOS=$os GOARCH=$arch go build \
|
||
|
|
-ldflags "-X forgejo.riotpiao.homelab.com/rock/kmsvc-cli/internal/cli.version=${VERSION}" \
|
||
|
|
-o "${out}" ./cmd/kmsvc
|
||
|
|
done
|
||
|
|
done
|
||
|
|
|
||
|
|
- name: release
|
||
|
|
uses: actions/forgejo-release@v2
|
||
|
|
with:
|
||
|
|
direction: upload
|
||
|
|
url: ${{ env.GITHUB_SERVER_URL }}
|
||
|
|
repo: ${{ env.GITHUB_REPOSITORY }}
|
||
|
|
release-dir: dist
|
||
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|