ci / vet, staticcheck, test, build (push) Canceled after 0s
Mirror the repository to github.com/k3nnyfr/glint and build releases there as well as on Gitea. - .github/workflows/ci.yml: vet, staticcheck, test, build - .github/workflows/release.yml: build the six platform binaries and publish a GitHub release on each v* tag - action.yml: download from GitHub releases and pick the binary matching the runner OS/arch instead of always linux-amd64 - README/INSTALL/CHANGELOG: document the mirror, Homebrew tap renamed to k3nnyfr/homebrew-glint Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
name: Build and publish release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build binaries
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
TAG: ${{ github.ref_name }}
|
|
run: |
|
|
mkdir -p dist
|
|
for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64; do
|
|
os=${target%/*}
|
|
arch=${target#*/}
|
|
ext=""
|
|
[ "$os" = "windows" ] && ext=".exe"
|
|
GOOS=$os GOARCH=$arch go build -trimpath \
|
|
-ldflags="-s -w -X main.version=${TAG}" \
|
|
-o "dist/glint-${TAG}-${os}-${arch}${ext}" \
|
|
./cmd/glint/...
|
|
echo "built: glint-${TAG}-${os}-${arch}${ext}"
|
|
done
|
|
|
|
- name: Create release and upload assets
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ github.ref_name }}
|
|
run: |
|
|
gh release create "$TAG" dist/* \
|
|
--repo "$GITHUB_REPOSITORY" \
|
|
--title "$TAG" \
|
|
--notes "See [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG}/CHANGELOG.md) for details."
|