1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-06-30 20:03:24 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
0c7c790386 use goreleaser 2021-03-26 17:33:22 +08:00
2 changed files with 74 additions and 29 deletions

View File

@ -1,35 +1,30 @@
name: build
on: on:
release: push:
types: [created] tags:
- 'v*'
jobs: jobs:
releases-matrix: goreleaser:
name: Release Go Binary
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm, arm64]
exclude:
- goos: darwin
goarch: arm
- goos: darwin
goarch: "386"
- goos: windows
goarch: arm64
steps: steps:
- uses: actions/checkout@v2 -
- name: Set RELEASE_VERSION env name: Checkout
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV uses: actions/checkout@v2.3.4
- uses: pcrbot/go-release-action@master
env:
CGO_ENABLED: 0
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }} -
goversion: "https://golang.org/dl/go1.16.linux-amd64.tar.gz" name: Set up Go
build_flags: -trimpath uses: actions/setup-go@v2
ldflags: -w -s with:
go-version: '1.16.2'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

50
.goreleaser.yml Normal file
View File

@ -0,0 +1,50 @@
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: arm
- goos: darwin
goarch: 386
- goos: windows
goarch: arm64
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- -s -w -X github.com/Mrs4s/go-cqhttp/coolq.Version=v{{.Version}}
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- fix typo
- Merge pull request
- Merge branch
- Merge remote-tracking
- go mod tidy
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format_overrides:
- goos: windows
format: zip