Skip to content

Commit

Permalink
add go releaser (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
adelowo authored Jan 11, 2025
1 parent 05efa53 commit 66c9223
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: goreleaser

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
# deploy/
id_ed25*
id_ed25519*
# Added by goreleaser init:
dist/
54 changes: 54 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: 2

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- env:
- CGO_ENABLED=0
main: ./cmd
goos:
- linux
- windows
- darwin

goarch:
- amd64
- arm64

ldflags:
- -s -w -X github.com/ayinke-llc/sdump.Version={{.Version}}

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
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 }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
checksum:
name_template: "checksums.txt"

0 comments on commit 66c9223

Please sign in to comment.