mirror of
https://github.com/wux1an/wxapkg.git
synced 2025-12-24 12:47:52 +08:00
feat: add GitHub action
This commit is contained in:
34
.github/workflows/release.yml
vendored
Normal file
34
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: 🎉 Release Binary
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install upx
|
||||
run: sudo apt install upx -y
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
51
.goreleaser.yml
Normal file
51
.goreleaser.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- main: .
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: 'arm64'
|
||||
|
||||
binary: 'wxapkg'
|
||||
|
||||
flags:
|
||||
- '-trimpath'
|
||||
ldflags:
|
||||
- '-s -w'
|
||||
- '-X main.version={{ .Version }}'
|
||||
- '-X main.commit={{ .ShortCommit }}'
|
||||
hooks:
|
||||
post: "upx --lzma {{ .Path }}"
|
||||
|
||||
changelog:
|
||||
filters:
|
||||
exclude:
|
||||
- '^doc:'
|
||||
- typo
|
||||
- (?i)foo
|
||||
- '^ref'
|
||||
- '^style'
|
||||
groups:
|
||||
- title: Features
|
||||
regexp: "^.*feat[(\\w)]*:+.*$"
|
||||
order: 0
|
||||
- title: 'Bug fixes'
|
||||
regexp: "^.*fix[(\\w)]*:+.*$"
|
||||
order: 1
|
||||
- title: Others
|
||||
order: 999
|
||||
|
||||
archives:
|
||||
- format: binary
|
||||
|
||||
checksum:
|
||||
algorithm: md5
|
||||
Reference in New Issue
Block a user