Skip to content

Commit

Permalink
use Github Action and Go-releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
RicheyJang committed Feb 25, 2022
1 parent 98c5f05 commit d0cfc0f
Show file tree
Hide file tree
Showing 6 changed files with 2,022 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release

on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.idea
*.yaml
!.goreleaser.yaml
*.exe
*.db
*.bat
*.sh
dist
log
ttf
data
/ttf
/data
go.sum
79 changes: 79 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
env:
- GO111MODULE=on
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on

goos:
- linux
- windows
goarch:
- amd64
- arm64
goarm:
- '7'
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: arm

main: ./cmd
binary: "paimeng" # 可执行文件名

archives:
-
name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"

replacements:
darwin: macOS
linux: Linux
windows: Windows
386: i386
amd64: x86_64

format_overrides:
- goos: windows
format: zip

wrap_in_directory: "paimengbot" # 压缩包内文件夹名,false为各文件独立

files:
# a more complete example, check the globbing deep dive below
- src: 'release/data/dialogue/*'
dst: 'data/dialogue'
strip_parent: true
- src: 'release/ttf/*'
dst: 'ttf'
strip_parent: true

checksum:
disable: true

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
groups:
- title: 新增
regexp: "^add[\\w\\s]*:+.*$"
order: 0
- title: '修复'
regexp: "^fix[\\s]*:+.*$"
order: 1
filters:
exclude:
- "^docs:"
- "^test:"
- fix typo
- Merge pull request
- Merge branch
- Merge remote-tracking
- go mod tidy
Loading

0 comments on commit d0cfc0f

Please sign in to comment.