Skip to content

Commit 70893a4

Browse files
committed
Code grooming for release
1 parent 5a7d21d commit 70893a4

File tree

18 files changed

+1382
-100
lines changed

18 files changed

+1382
-100
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**
2+
!axiom-honeycomb-proxy

.github/workflows/pr.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
env:
9+
GOVERSION: "1.16"
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-go@v2
18+
with:
19+
go-version: ${{ env.GOVERSION }}
20+
- uses: golangci/golangci-lint-action@v2
21+
22+
test:
23+
name: Test
24+
needs: lint
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-go@v2
29+
with:
30+
go-version: ${{ env.GOVERSION }}
31+
- uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/go/pkg/mod
35+
~/.cache/go-build
36+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+
restore-keys: ${{ runner.os }}-go-
38+
- run: make test
39+
- uses: codecov/codecov-action@v1
40+
with:
41+
fail_ci_if_error: true
42+
- uses: creekorful/goreportcard-action@v1.0
43+
44+
build:
45+
name: Build
46+
needs: test
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 0
52+
- uses: actions/setup-go@v2
53+
with:
54+
go-version: ${{ env.GOVERSION }}
55+
- uses: actions/cache@v2
56+
with:
57+
path: |
58+
~/go/pkg/mod
59+
~/.cache/go-build
60+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
61+
restore-keys: ${{ runner.os }}-go-
62+
- uses: goreleaser/goreleaser-action@v2
63+
with:
64+
args: build --snapshot

.github/workflows/push.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
GOVERSION: "1.16"
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-go@v2
18+
with:
19+
go-version: ${{ env.GOVERSION }}
20+
- uses: golangci/golangci-lint-action@v2
21+
22+
test:
23+
name: Test
24+
needs: lint
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-go@v2
29+
with:
30+
go-version: ${{ env.GOVERSION }}
31+
- uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/go/pkg/mod
35+
~/.cache/go-build
36+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+
restore-keys: ${{ runner.os }}-go-
38+
- run: make test
39+
- uses: codecov/codecov-action@v1
40+
with:
41+
fail_ci_if_error: true
42+
- uses: creekorful/goreportcard-action@v1.0
43+
44+
build:
45+
name: Build
46+
needs: test
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
with:
51+
fetch-depth: 0
52+
- uses: actions/setup-go@v2
53+
with:
54+
go-version: ${{ env.GOVERSION }}
55+
- uses: actions/cache@v2
56+
with:
57+
path: |
58+
~/go/pkg/mod
59+
~/.cache/go-build
60+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
61+
restore-keys: ${{ runner.os }}-go-
62+
- uses: goreleaser/goreleaser-action@v2
63+
with:
64+
args: build --snapshot

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
env:
9+
GOVERSION: "1.16"
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-go@v2
20+
with:
21+
go-version: ${{ env.GOVERSION }}
22+
- uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/go/pkg/mod
26+
~/.cache/go-build
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: ${{ runner.os }}-go-
29+
- uses: docker/login-action@v1
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_PASSWORD }}
33+
- uses: goreleaser/goreleaser-action@v2
34+
with:
35+
args: release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@
1111
# Output of the go coverage tool, specifically when used with LiteIDE
1212
*.out
1313

14-
# Dependency directories (remove the comment below to include it)
15-
# vendor/
14+
# Build artifacts
15+
dist
16+
17+
# Go mod timestamp for Makefile
18+
/dep.stamp
19+
20+
# Local $GOBIN directory for tools
21+
/bin/

.golangci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
run:
2+
modules-download-mode: readonly
3+
skip-dirs:
4+
- .git
5+
- .github
6+
- .vscode
7+
- bin
8+
- dist
9+
10+
linters:
11+
disable-all: true
12+
enable:
13+
- bodyclose
14+
- deadcode
15+
- dogsled
16+
- dupl
17+
- errcheck
18+
- exportloopref
19+
- goconst
20+
- gofmt
21+
- goimports
22+
- golint
23+
- gosec
24+
- gosimple
25+
- govet
26+
- ineffassign
27+
- misspell
28+
- nolintlint
29+
- prealloc
30+
- staticcheck
31+
- structcheck
32+
- stylecheck
33+
- typecheck
34+
- unconvert
35+
- unparam
36+
- unused
37+
- varcheck
38+
- whitespace
39+
40+
linters-settings:
41+
gofmt:
42+
simplify: true
43+
goimports:
44+
local-prefixes: github.com/axiomhq/axiom-honeycomb-proxy
45+
govet:
46+
check-shadowing: true

.goreleaser.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
project_name: axiom-honeycomb-proxy
2+
3+
builds:
4+
- <<: &build_defaults
5+
binary: axiom-honeycomb-proxy
6+
main: ./cmd/axiom-honeycomb-proxy
7+
env:
8+
- CGO_ENABLED=0
9+
flags:
10+
- -buildmode=pie
11+
- -installsuffix=cgo
12+
- -trimpath
13+
- -tags="osusergo netgo static_build"
14+
ldflags:
15+
- -s -w -extldflags "-fno-PIC -static -Wl -z now -z relro"
16+
- -X github.com/axiomhq/pkg/version.release={{ .Version }}
17+
- -X github.com/axiomhq/pkg/version.revision={{ .ShortCommit }}
18+
- -X github.com/axiomhq/pkg/version.buildDate={{ .CommitDate }}
19+
- -X github.com/axiomhq/pkg/version.buildUser=goreleaser
20+
mod_timestamp: "{{ .CommitTimestamp }}"
21+
id: darwin
22+
goos:
23+
- darwin
24+
goarch:
25+
- amd64
26+
- arm64
27+
28+
- <<: *build_defaults
29+
id: linux
30+
goos:
31+
- linux
32+
goarch:
33+
- amd64
34+
- arm64
35+
36+
- <<: *build_defaults
37+
flags:
38+
- -buildmode=exe
39+
- -installsuffix=cgo
40+
- -trimpath
41+
- -tags="osusergo netgo static_build"
42+
id: linux-no-pie
43+
goos:
44+
- linux
45+
goarch:
46+
- arm
47+
- 386
48+
goarm:
49+
- 6
50+
- 7
51+
52+
- <<: *build_defaults
53+
flags:
54+
- -buildmode=exe
55+
- -installsuffix=cgo
56+
- -trimpath
57+
- -tags="osusergo netgo static_build"
58+
id: docker
59+
goos:
60+
- linux
61+
goarch:
62+
- amd64
63+
64+
- <<: *build_defaults
65+
id: windows
66+
goos:
67+
- windows
68+
goarch:
69+
- amd64
70+
- 386
71+
72+
archives:
73+
- <<: &archive_defaults
74+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
75+
id: nix
76+
builds:
77+
- darwin
78+
- linux
79+
- linux-no-pie
80+
wrap_in_directory: true
81+
format: tar.gz
82+
files:
83+
- LICENSE
84+
- README.md
85+
- <<: *archive_defaults
86+
id: windows
87+
builds:
88+
- windows
89+
wrap_in_directory: false
90+
format: zip
91+
files:
92+
- LICENSE
93+
- README.md
94+
95+
checksum:
96+
name_template: checksums.txt
97+
98+
snapshot:
99+
name_template: "{{ .Tag }}-next"
100+
101+
changelog:
102+
sort: asc
103+
filters:
104+
exclude:
105+
- "^docs:"
106+
- "^test:"
107+
108+
milestones:
109+
- repo:
110+
owner: axiomhq
111+
name: axiom-honeycomb-proxy
112+
close: true
113+
fail_on_error: false
114+
115+
release:
116+
github:
117+
owner: axiomhq
118+
name: axiom-honeycomb-proxy
119+
prerelease: auto
120+
name_template: "Axiom Honeycomb Proxy v{{ .Version }}"
121+
122+
brews:
123+
- name: axiom-honeycomb-proxy
124+
description: Honeycomb compatible log forwarding and multiplexing proxy for Axiom
125+
homepage: https://axiom.co
126+
license: MIT
127+
tap:
128+
owner: axiomhq
129+
name: homebrew-tap
130+
token: "{{ .Env.HOMEBREW_TOKEN }}"
131+
commit_author:
132+
name: axiom-automation
133+
email: hello@axiom.co
134+
skip_upload: auto
135+
folder: Formula
136+
install: bin.install "{{ .ProjectName }}"
137+
test: assert_match "x", "x"
138+
139+
dockers:
140+
- ids:
141+
- docker
142+
image_templates:
143+
- "axiomhq/axiom-honeycomb-proxy:{{ .Major }}"
144+
- "axiomhq/axiom-honeycomb-proxy:{{ .Major }}.{{ .Minor }}"
145+
- "axiomhq/axiom-honeycomb-proxy:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
146+
- "axiomhq/axiom-honeycomb-proxy:latest"

0 commit comments

Comments
 (0)