Skip to content

Commit f8f4bf2

Browse files
authored
Add goreleaser & a gh workflow (#503)
* Add goreleaser & a gh workflow * format code
1 parent cc4da66 commit f8f4bf2

File tree

4 files changed

+67
-3
lines changed

4 files changed

+67
-3
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
-
18+
name: Set up Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.16
22+
-
23+
name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v2
25+
with:
26+
version: latest
27+
args: release --rm-dist
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
---
4+
archives:
5+
-
6+
replacements:
7+
386: i386
8+
amd64: x86_64
9+
darwin: Darwin
10+
linux: Linux
11+
windows: Windows
12+
before:
13+
hooks:
14+
- "go mod download"
15+
- "go generate ./..."
16+
builds:
17+
-
18+
env:
19+
- CGO_ENABLED=0
20+
goos:
21+
- linux
22+
- darwin
23+
- windows
24+
25+
changelog:
26+
filters:
27+
exclude:
28+
- "^docs:"
29+
- "^test:"
30+
sort: asc
31+
checksum:
32+
name_template: checksums.txt
33+
snapshot:
34+
name_template: "{{ .Tag }}-next"
35+
project_name: revive

rule/blank-imports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func (r *BlankImportsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failu
2222
}
2323

2424
const (
25-
message = "a blank import should be only in a main or test package, or have a comment justifying it"
26-
category = "imports"
25+
message = "a blank import should be only in a main or test package, or have a comment justifying it"
26+
category = "imports"
2727

2828
embedImportPath = `"embed"`
2929
)

rule/struct-tag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (w lintStructTagRule) checkJSONTag(name string, options []string) (string,
168168
case "":
169169
// special case for JSON key "-"
170170
if name != "-" {
171-
return "option can not be empty in JSON tag", false
171+
return "option can not be empty in JSON tag", false
172172
}
173173
default:
174174
return fmt.Sprintf("unknown option '%s' in JSON tag", opt), false

0 commit comments

Comments
 (0)