Skip to content

Commit

Permalink
chore(workflow): Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wsshow committed Jun 20, 2023
1 parent 28a7206 commit 8c1de15
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: goreleaser

on:
push:
tags:
- '*'

permissions:
contents: write

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

- name: Set up Go
uses: actions/setup-go@v4
with:
version: latest

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
main: .
ldflags: -s -w
goos:
- linux
- windows
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
- riscv
- riscv64
- mips64

archives:
- format: zip
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
release:
github:
owner: wsshow
name: envchecker
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit 8c1de15

Please sign in to comment.