53 Star 348 Fork 124

feiyu563 / PrometheusAlert

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.goreleaser.yaml 1.87 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
zhang21 提交于 2021-12-28 11:38 . add: goreleaser自动发布
project_name: PrometheusAlert
env:
- GO11MODULE=on
- GO111MODULE=on
- GOPROXY=https://goproxy.io
# go-sqlite3需要启用cgo
# cgo比较麻烦,交叉编译需要安装特定架构gcc来支持
- CGO_ENABLED=1
before:
hooks:
- go mod tidy
- go mod vendor
builds:
- id: build-linux
main: main.go
binary: PrometheusAlert
ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
goos:
- linux
goarch:
- amd64
# 在linux上交叉编译windows cgo需要mingw64-gcc模块
- id: build-windows
main: main.go
binary: PrometheusAlert
ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
# 在linux上交叉编译arm64 cgo需要arm64 gcc模块
#- id: build-arm
# main: main.go
# binary: PrometheusAlert
# ldflags: -s -w -X main.Version=${{.Version}} -X main.Revision={{.ShortCommit}} -X main.BuildDate={{.Date}} -X main.BuildUser=goreleaser
# env:
# - CC=aarch64-linux-gnu-gcc
# - CXX=aarch64-linux-gnu-g++
# goos:
# - linux
# goarch:
# - arm64
archives:
- id: archive-package
format: tar.gz
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: true
replacements:
linux: Linux
windows: Windows
386: i386
amd64: x86_64
arm64: ARM64
format_overrides:
- goos: windows
format: zip
files:
- conf/app-example.conf
- db/
- logs/
- static/
- views/
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Version }}_snapshot"
Go
1
https://gitee.com/feiyu563/PrometheusAlert.git
git@gitee.com:feiyu563/PrometheusAlert.git
feiyu563
PrometheusAlert
PrometheusAlert
master

搜索帮助

14c37bed 8189591 565d56ea 8189591