Skip to content

Commit 4838476

Browse files
Merge pull request #510 from zmap/phillip/go-releaser-2
Add a goreleaser.yml and directions for making a release in RELEASE.md
2 parents 97156c1 + 94b3b3b commit 4838476

File tree

3 files changed

+86
-1
lines changed

3 files changed

+86
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
*.iml
44
*.code-workspace
55
/zdns
6-
*.log
6+
*.log# Added by goreleaser init:
7+
dist/

.goreleaser.yaml

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

RELEASE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Releasing a New Version of ZDNS
2+
We use [goreleaser](https://goreleaser.com) to release new versions of ZDNS. To release a new version, follow these steps:
3+
4+
0. Install `goreleaser`:
5+
```shell
6+
brew install goreleaser/tap/goreleaser
7+
```
8+
9+
1. Create a new tag and push to GH:
10+
```shell
11+
git tag -a vA.B.C -m "Release A.B.C"
12+
```
13+
14+
2. Test the release:
15+
```shell
16+
goreleaser release --skip-publish --clean
17+
```
18+
19+
3. Set GitHub Token (at least configured with `write:packages`)
20+
```shell
21+
export GITHUB_TOKEN="YOUR_GH_TOKEN"
22+
```
23+
4. Push Tag to Github
24+
Be sure that this tagged commit is what you want to tag. Once you push you shouldn't delete the tagged version.
25+
```shell
26+
git push origin vA.B.C
27+
```
28+
5. Release!
29+
```shell
30+
goreleaser release --clean
31+
```
32+
6. Update the [Release Notes](https://github.com/zmap/zdns/releases) with a description of your changes

0 commit comments

Comments
 (0)