Skip to content

Commit 97adb17

Browse files
committed
ci: add releaser
1 parent 8dd8e0a commit 97adb17

File tree

11 files changed

+593
-67
lines changed

11 files changed

+593
-67
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'beta'
8+
tags:
9+
- 'v*'
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Version (No "v")'
14+
required: true
15+
type: string
16+
pull_request:
17+
jobs:
18+
goreleaser:
19+
runs-on: ubuntu-latest
20+
steps:
21+
-
22+
name: Checkout
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
-
27+
name: Set up Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.19
31+
-
32+
name: Tests
33+
run: |
34+
go mod tidy
35+
go test -v ./...
36+
-
37+
name: Run GoReleaser
38+
uses: goreleaser/goreleaser-action@v2
39+
if: success() && startsWith(github.ref, 'refs/tags/')
40+
with:
41+
version: "v1.17.2"
42+
args: release --rm-dist --skip-validate
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.exe
2+
go.sum
3+
*.log
4+
.idea
5+
*.opq
6+
dist
7+
config.yaml

.goreleaser.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- id: "Yui"
6+
main: ./
7+
env:
8+
- CGO_ENABLED=0
9+
goarm:
10+
- 6
11+
- 7
12+
goarch:
13+
- amd64
14+
- arm
15+
- arm64
16+
- 386
17+
goos:
18+
- linux
19+
- windows
20+
- darwin
21+
ignore:
22+
- goos: android
23+
goarch: arm
24+
- goos: darwin
25+
goarch: 386
26+
- goos: darwin
27+
goarch: arm
28+
- goos: windows
29+
goarch: arm
30+
- goos: windows
31+
goarch: arm64
32+
- goos: android
33+
goarch: 386
34+
- id: "Yui-cli"
35+
binary: "Yui-cli"
36+
main: ./plugin/builder
37+
env:
38+
- CGO_ENABLED=0
39+
goarm:
40+
- 6
41+
- 7
42+
goarch:
43+
- amd64
44+
- arm
45+
- arm64
46+
- 386
47+
goos:
48+
- linux
49+
- windows
50+
- darwin
51+
ignore:
52+
- goos: android
53+
goarch: arm
54+
- goos: darwin
55+
goarch: 386
56+
- goos: darwin
57+
goarch: arm
58+
- goos: windows
59+
goarch: arm
60+
- goos: windows
61+
goarch: arm64
62+
- goos: android
63+
goarch: 386
64+
archives:
65+
-
66+
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
67+
format_overrides:
68+
- goos: windows
69+
format: zip
70+
replacements:
71+
darwin: Darwin
72+
linux: Linux
73+
windows: Windows
74+
386: i386
75+
amd64: x86_64
76+
files:
77+
- config.yaml.example
78+
- LICENSE
79+
release:
80+
prerelease: auto
81+
checksum:
82+
name_template: 'checksums.txt'
83+
project_name: Yui
84+
changelog:
85+
sort: asc
86+
filters:
87+
exclude:
88+
- '^docs:'
89+
- '^test:'

config.yaml.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
httpproxy: http://127.0.0.1:7890 # 插件 HTTP 服务时会使用的 Proxy
2+
opqurl: http://127.0.0.1:8086 # OPQ 的地址
3+
admin:
4+
- 0 # 管理员
5+
plugin:
6+
env:
7+
test: opqbot # 环境变量 将会传递到插件内

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ go 1.19
55
require (
66
github.com/charmbracelet/log v0.2.1
77
github.com/ethereum/go-ethereum v1.11.6
8-
github.com/fogleman/gg v1.3.0
9-
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
108
github.com/google/uuid v1.3.0
119
github.com/imroc/req/v3 v3.33.2
1210
github.com/knqyf263/go-plugin v0.7.1-0.20230420183704-82cf9090ca1e
@@ -20,7 +18,6 @@ require (
2018
github.com/spf13/viper v1.15.0
2119
github.com/tetratelabs/wazero v1.0.3
2220
github.com/tidwall/gjson v1.14.4
23-
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
2421
golang.org/x/tools v0.8.0
2522
google.golang.org/protobuf v1.30.0
2623
)
@@ -63,6 +60,7 @@ require (
6360
github.com/quic-go/quic-go v0.32.0 // indirect
6461
github.com/rivo/uniseg v0.2.0 // indirect
6562
github.com/rotisserie/eris v0.5.4 // indirect
63+
github.com/shoenig/go-m1cpu v0.1.4 // indirect
6664
github.com/spf13/afero v1.9.3 // indirect
6765
github.com/spf13/jwalterweatherman v1.1.0 // indirect
6866
github.com/spf13/pflag v1.0.5 // indirect

plugin/meta/meta_generate.go

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)