Skip to content

Commit

Permalink
ops: add goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
greenpau committed Dec 3, 2023
1 parent 9aa6dd9 commit 04ef714
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.20.7'
cache: true
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPATH: /home/runner/go
55 changes: 55 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
project_name: authp

release:
github:
owner: greenpau
name: go-authcrunch
draft: false
prerelease: auto

checksum:
name_template: "{{.ProjectName}}_{{.Version}}_SHA256SUMS"

builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: ./cmd/authdbctl
binary: ./bin/authdbctl
flags:
- -trimpath
- -mod=readonly
asmflags:
- all=-trimpath={{.Env.GOPATH}}
gcflags:
- all=-trimpath={{.Env.GOPATH}}
ldflags: -s -w


nfpms:
- id: authp
maintainer: "Paul Greenberg <greenpau@outlook.com>"
file_name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
changelog:
sort: asc
filters:
exclude:
- '^docs?:'
- '^readme:'
- '^tests?:'
- '^github:'
- '^ops:'
# - '^\w+\s+' # a hack to remove commit messages without colons thus don't correspond to a package
2 changes: 1 addition & 1 deletion pkg/identity/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func init() {
app.Documentation = "https://github.com/greenpau/go-authcrunch"
app.SetVersion(appVersion, "1.0.45")
app.SetGitBranch(gitBranch, "main")
app.SetGitCommit(gitCommit, "v1.0.44-4-g2ff7fcd")
app.SetGitCommit(gitCommit, "v1.0.45")
app.SetBuildUser(buildUser, "")
app.SetBuildDate(buildDate, "")
}
Expand Down

0 comments on commit 04ef714

Please sign in to comment.