feat(build): add GitHub mirror CI and release workflows
ci / vet, staticcheck, test, build (push) Canceled after 0s
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>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: vet, staticcheck, test, build
|
||||
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: vet
|
||||
run: go vet ./...
|
||||
|
||||
- name: staticcheck
|
||||
run: go tool staticcheck ./...
|
||||
|
||||
- name: test
|
||||
run: go test ./...
|
||||
|
||||
- name: build
|
||||
run: go build ./cmd/glint/...
|
||||
@@ -0,0 +1,51 @@
|
||||
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."
|
||||
Reference in New Issue
Block a user