Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 81a6227

Browse files
Add goreleaser
1 parent 3aa3007 commit 81a6227

File tree

5 files changed

+77
-4
lines changed

5 files changed

+77
-4
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- run: git fetch --force --tags
16+
- uses: actions/setup-go@v3
17+
with:
18+
go-version: ">=1.20.1"
19+
cache: true
20+
- uses: goreleaser/goreleaser-action@v4
21+
with:
22+
distribution: goreleaser
23+
version: latest
24+
args: release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313

1414
# Dependency directories (remove the comment below to include it)
1515
# vendor/
16+
17+
dist/

.goreleaser.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
before:
4+
hooks:
5+
# You may remove this if you don't use go modules.
6+
- go mod tidy
7+
# you may remove this if you don't need go generate
8+
# - go generate ./...
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- linux
14+
15+
archives:
16+
- format: tar.gz
17+
# this name template makes the OS and Arch compatible with the results of uname.
18+
name_template: >-
19+
{{ .ProjectName }}_
20+
{{- title .Os }}_
21+
{{- if eq .Arch "amd64" }}x86_64
22+
{{- else if eq .Arch "386" }}i386
23+
{{- else }}{{ .Arch }}{{ end }}
24+
{{- if .Arm }}v{{ .Arm }}{{ end }}
25+
# use zip for windows archives
26+
format_overrides:
27+
- goos: windows
28+
format: zip
29+
wrap_in_directory: true
30+
checksum:
31+
name_template: "checksums.txt"
32+
snapshot:
33+
name_template: "{{ incpatch .Version }}-next"
34+
changelog:
35+
sort: asc
36+
filters:
37+
exclude:
38+
- "^docs:"
39+
- "^test:"
40+
# The lines beneath this are called `modelines`. See `:help modeline`
41+
# Feel free to remove those if you don't want/use them.
42+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
43+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module github.com/evilhamsterman/goathtool
22

33
go 1.20
44

5-
require (
6-
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
7-
github.com/pquerna/otp v1.4.0 // indirect
8-
)
5+
require github.com/pquerna/otp v1.4.0
6+
7+
require github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI=
22
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
3+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
34
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
46
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
57
github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg=
68
github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
79
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
10+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
811
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=

0 commit comments

Comments
 (0)