mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
✏️ 改用 gocq 同款 release
This commit is contained in:
parent
c183c4f17d
commit
1dbb4aa837
54
.github/workflows/prerelease.yml
vendored
54
.github/workflows/prerelease.yml
vendored
@ -2,54 +2,26 @@ name: 测试版
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- p*
|
- 'p*'
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
my-job:
|
goreleaser:
|
||||||
name: Build ZeroBot-Plugin on Push Tag 🚀
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
go-version: '1.17'
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Run GoReleaser
|
||||||
uses: actions/checkout@v2
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
|
||||||
- name: Cache Go
|
|
||||||
id: cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
# A list of files, directories, and wildcard patterns to cache and restore
|
version: latest
|
||||||
path: ~/go/pkg/mod
|
args: release --rm-dist
|
||||||
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Tidy Go modules
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: Build linux-x64
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x64
|
|
||||||
- name: Build linux-x86
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x86
|
|
||||||
- name: Build windows-x64
|
|
||||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x64.exe
|
|
||||||
- name: Build windows-x86
|
|
||||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x86.exe
|
|
||||||
- name: Build arm64
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-arm64
|
|
||||||
- name: Build armv6
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6
|
|
||||||
|
|
||||||
- name: Upload binaries to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
file: artifacts/zerobot-plugin-*
|
|
||||||
tag: ${{ github.ref }}
|
|
||||||
overwrite: true
|
|
||||||
file_glob: true
|
|
||||||
|
|||||||
54
.github/workflows/release.yml
vendored
54
.github/workflows/release.yml
vendored
@ -2,54 +2,26 @@ name: 稳定版
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- 'v*'
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
my-job:
|
goreleaser:
|
||||||
name: Build ZeroBot-Plugin on Push Tag 🚀
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
go-version: '1.17'
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Run GoReleaser
|
||||||
uses: actions/checkout@v2
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
|
||||||
- name: Cache Go
|
|
||||||
id: cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
# A list of files, directories, and wildcard patterns to cache and restore
|
version: latest
|
||||||
path: ~/go/pkg/mod
|
args: release --rm-dist
|
||||||
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Tidy Go modules
|
|
||||||
run: go mod tidy
|
|
||||||
|
|
||||||
- name: Build linux-x64
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x64
|
|
||||||
- name: Build linux-x86
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-x86
|
|
||||||
- name: Build windows-x64
|
|
||||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x64.exe
|
|
||||||
- name: Build windows-x86
|
|
||||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-windows-x86.exe
|
|
||||||
- name: Build arm64
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-arm64
|
|
||||||
- name: Build armv6
|
|
||||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o artifacts/zerobot-plugin-linux-armv6
|
|
||||||
|
|
||||||
- name: Upload binaries to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
file: artifacts/zerobot-plugin-*
|
|
||||||
tag: ${{ github.ref }}
|
|
||||||
overwrite: true
|
|
||||||
file_glob: true
|
|
||||||
|
|||||||
89
.goreleaser.yml
Normal file
89
.goreleaser.yml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
env:
|
||||||
|
- GO111MODULE=on
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
builds:
|
||||||
|
- id: nowin
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
- GO111MODULE=on
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- 386
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- 6
|
||||||
|
- 7
|
||||||
|
ignore:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
- goos: darwin
|
||||||
|
goarch: 386
|
||||||
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w
|
||||||
|
- id: win
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
- GO111MODULE=on
|
||||||
|
goos:
|
||||||
|
- windows
|
||||||
|
goarch:
|
||||||
|
- 386
|
||||||
|
- amd64
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- 7
|
||||||
|
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||||
|
flags:
|
||||||
|
- -trimpath
|
||||||
|
ldflags:
|
||||||
|
- -s -w
|
||||||
|
|
||||||
|
checksum:
|
||||||
|
name_template: "zbp_checksums.txt"
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "^docs:"
|
||||||
|
- "^test:"
|
||||||
|
- fix typo
|
||||||
|
- Merge pull request
|
||||||
|
- Merge branch
|
||||||
|
- Merge remote-tracking
|
||||||
|
- go mod tidy
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- id: binary
|
||||||
|
builds:
|
||||||
|
- win
|
||||||
|
name_template: "zbp_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||||
|
format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: binary
|
||||||
|
- id: nowin
|
||||||
|
builds:
|
||||||
|
- nowin
|
||||||
|
- win
|
||||||
|
name_template: "zbp_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
||||||
|
format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: zip
|
||||||
|
|
||||||
|
nfpms:
|
||||||
|
- license: AGPL 3.0
|
||||||
|
homepage: https://go-cqhttp.org
|
||||||
|
file_name_template: "zbp_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
|
formats:
|
||||||
|
- deb
|
||||||
|
- rpm
|
||||||
|
maintainer: Kanri, DawnNights, Fumiama, Suika
|
||||||
Loading…
Reference in New Issue
Block a user