Skip to content

Commit

Permalink
chore: add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
nohehf committed Mar 11, 2023
1 parent ca72f6e commit 610e1f5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🎉 Release Binary

on:
push:
tags:
- "*"
workflow_dispatch:

jobs:
goreleaser:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-go@v3
with:
go-version: 1.20.x

- uses: goreleaser/goreleaser-action@v4
with:
args: "release --clean"
version: latest
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ testers
!internal/utils/assets/wordlist.txt

# ignore builds
goctopus
goctopus

dist/
.env
23 changes: 23 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- "386"
- amd64
- arm64
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}/{{ .ProjectName }}.go

# will not auto-publish the release
release:
draft: true

checksum:
algorithm: sha256

0 comments on commit 610e1f5

Please sign in to comment.