Skip to content

Commit

Permalink
add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
makifdb committed Apr 7, 2022
1 parent 71b4e76 commit a08fff6
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: goreleaser

on:
push:
tags:
- v*

permissions:
contents: write

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

- name: Fetch all tags 🏷️
run: git fetch --force --tags

- name: Set up Go ⚙️
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: Tests 🧪
run: |
go mod tidy
go test -v ./...
- name: Run GoReleaser 🚀
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
builds:
- goos:
- linux
- darwin
- windows
goarch:
- amd64

archives:
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}'
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'

nfpms:
- formats:
- deb
- rpm

0 comments on commit a08fff6

Please sign in to comment.