Skip to content

Commit

Permalink
add goreleaser workflow
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <[email protected]>
  • Loading branch information
zwwhdls committed Jun 27, 2024
1 parent 679a160 commit 389c173
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 49 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: goreleaser

on:
release:
types:
- created

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project_name: nanafs
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod download
builds:
- id: nanafs-darwin-amd64
ldflags: -s -w -X config.gitCommit={{.ShortCommit}} -X config.gitTag={{.Version}}
main: .
goos:
- darwin
goarch:
- amd64
- id: nanafs-darwin-arm64
ldflags: -s -w -X config.gitCommit={{.ShortCommit}} -X config.gitTag={{.Version}}
main: .
goos:
- darwin
goarch:
- arm64
- id: nanafs-linux-amd64
ldflags: -s -w -X config.gitCommit={{.ShortCommit}} -X config.gitTag={{.Version}}
main: .
goos:
- linux
goarch:
- amd64
- id: nanafs-linux-arm64
ldflags: -s -w -X config.gitCommit={{.ShortCommit}} -X config.gitTag={{.Version}}
main: .
goos:
- linux
goarch:
- arm64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
49 changes: 0 additions & 49 deletions .goreleaser.yml

This file was deleted.

0 comments on commit 389c173

Please sign in to comment.