fix: github action

This commit is contained in:
LollipopKit 2023-03-18 00:34:33 +08:00
parent f4aa483a2a
commit 1619e64e00
2 changed files with 17 additions and 31 deletions

View File

@ -5,22 +5,27 @@ on:
tags:
- 'v*'
permissions:
contents: write
# packages: write
# issues: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: 1.20
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
go-version: '>=1.20.2'
cache: true
- run: go mod tidy
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,31 +1,12 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
project_name: server_box_monitor
builds:
- env:
- CGO_ENABLED=0
- env: [CGO_ENABLED=0]
goos:
- linux
goarch:
- amd64
- arm
- arm64
- arm
goarm:
- 6
- 7
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'