Skip to content

Commit

Permalink
fix: goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 committed Jun 30, 2023
1 parent a9e241e commit 150e9b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: write

jobs:
goreleaser:
name: Build
Expand All @@ -17,16 +20,16 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: 'go.mod'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 16 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ before:
builds:
- env:
- CGO_ENABLED=0
flags:
- -trimpath
goos:
- linux
- windows
Expand All @@ -21,12 +23,20 @@ builds:
ldflags:
- -s -w -X main.version={{.Tag}} -X main.buildTime={{.Date}}
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
# use zip for windows archives
- format_overrides:
- goos: windows
format: zip
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Mips }}_{{ .Mips }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down

0 comments on commit 150e9b6

Please sign in to comment.