2017-10-11 08:33:17 -04:00
---
layout: default
title: How to build and ship a release
---
2017-08-24 08:32:51 -07:00
# How to build and ship a release
2017-11-02 14:51:52 -07:00
2020-03-22 15:36:35 -04:00
These are the instructions for producing a release.
2017-08-24 08:32:51 -07:00
2022-08-15 10:41:45 -04:00
CircleCI will do most of the work for you. You will need to edit the draft release notes.
2020-01-28 10:44:07 -05:00
2022-08-15 10:41:45 -04:00
Please change the version number as appropriate. Substitute (for example)
`3.19.0` any place you see `VERSION` in this doc.
2020-03-22 15:36:35 -04:00
2022-08-15 10:41:45 -04:00
## Step 1. Tag the commit in master that you want to release
2020-03-22 15:36:35 -04:00
2022-08-15 10:41:45 -04:00
```shell
git tag -a v3.19.0
git push origin --tags
2020-03-22 15:36:35 -04:00
```
2022-08-15 10:41:45 -04:00
See [Git Docs ](https://git-scm.com/book/en/v2/Git-Basics-Tagging ) for more examples.
2020-02-12 13:51:00 -05:00
2022-08-15 10:41:45 -04:00
Soon after
CircleCI will start a [build ](https://app.circleci.com/pipelines/github/StackExchange/dnscontrol?branch=master ) Workflow and produce all of the artifacts for the release.
2021-10-03 15:41:46 -04:00
2022-08-15 10:41:45 -04:00

2021-07-01 10:17:43 -04:00
2022-08-15 10:41:45 -04:00
## Step 2. Create the release notes
2021-07-01 10:17:43 -04:00
2022-08-15 10:41:45 -04:00
The draft release notes are created for you. In this step you'll edit them.
2021-07-01 10:17:43 -04:00
2022-08-15 10:41:45 -04:00
The CircleCI build uses [GoReleaser ](https://goreleaser.com/ ) which produces the [GitHub Release ](https://github.com/StackExchange/dnscontrol/releases ) with Release Notes derived from the commit history between now and the last tag.
These notes are just a draft and needs considerable editing.
You can also find a copy of the release notes in the CircleCI `release` job Artifacts.
These release notes will be used in multiple places (release notes, email announcements, etc.)
2021-07-01 10:17:43 -04:00
2022-08-15 10:41:45 -04:00
Release notes style guide:
2021-10-03 15:41:46 -04:00
2022-08-15 10:41:45 -04:00
* Entries in the bullet list should be phrased in the positive: "Feature FOO now does BAR". This is often the opposite of the related issue, which was probably phrased, "Feature FOO is broken because of BAR".
* Every item should include the ID of the issue related to the change. If there was no issue, create one and close it.
* Sort the list most important/exciting changes earlier in the list.
* Items related to a specific provier should begin with the all-caps name of the provider, such as "ROUTE53: Added support for sandwiches (#100 )"
* The `Depreciation warnings` section should just copy from `README.md` . If you change one, change it in the README too (you can make that change in this PR).
2020-02-12 13:51:00 -05:00
See [https://github.com/StackExchange/dnscontrol/releases for examples ](https://github.com/StackExchange/dnscontrol/releases ) for recent release notes and copy that style.
Example/template:
2022-02-17 18:22:31 +01:00
```text
2020-02-12 13:51:00 -05:00
This release includes many new providers (JoeDNS and MaryDNS), dozens
of bug fixes, and a new testing framework that makes it easier to add
big features without fear of breaking old ones.
Major features:
* NEW PROVIDER: Providername (#issueid )
* Add FOO DNS record support (#issueid )
* Add SIP/JABBER labels to underscore exception list (#453 )
Provider-specific changes:
* PROVIDER: New feature or thing (#issueid )
* PROVIDER: Another feature or bug fixed (#issueid )
* CLOUDFLARE: Fix CF trying to update non-changeable TTL (#issueid )
```
2022-08-15 10:41:45 -04:00
## Step 2. Announce it via email
2017-11-02 14:51:52 -07:00
2020-02-12 13:51:00 -05:00
Email the release notes to the mailing list: (note the format of the Subject line and that the first line of the email is the URL of the release)
2017-08-24 08:32:51 -07:00
2022-02-17 18:22:31 +01:00
```text
2017-08-24 08:32:51 -07:00
To: dnscontrol-discuss@googlegroups .com
2020-01-28 16:59:09 -05:00
Subject: New release: dnscontrol v$VERSION
2017-08-24 08:32:51 -07:00
2020-01-28 16:59:09 -05:00
https://github.com/StackExchange/dnscontrol/releases/tag/v$VERSION
2017-08-24 08:32:51 -07:00
2020-02-12 13:51:00 -05:00
[insert the release notes here]
2017-08-24 08:32:51 -07:00
```
2020-02-12 13:51:00 -05:00
NOTE: You won't be able to post to the mailing list unless you are on
it. [Click here to join ](https://groups.google.com/forum/#!forum/dnscontrol-discuss ).
2022-08-15 10:41:45 -04:00
## Step 3. Announce it via chat
2017-11-02 16:35:08 -07:00
Mention on [https://gitter.im/dnscontrol/Lobby ](https://gitter.im/dnscontrol/Lobby ) that the new release has shipped.
2022-02-17 18:22:31 +01:00
```text
2021-01-30 15:18:21 +00:00
ANNOUNCEMENT: dnscontrol v$VERSION has been released! https://github.com/StackExchange/dnscontrol/releases/tag/v$VERSION
2017-11-02 16:35:08 -07:00
```
2022-08-15 10:41:45 -04:00
## Step 4. Get credit
2017-11-02 14:51:52 -07:00
Mention the fact that you did this release in your weekly accomplishments.
2018-03-16 13:07:42 -04:00
If you are at Stack Overflow:
2022-08-15 10:41:45 -04:00
* Add the release to your weekly snippets
* Run this build: `dnscontrol_embed - Promote most recent artifact into ExternalDNS repo`
2020-02-12 13:51:00 -05:00
2022-08-15 10:41:45 -04:00
## Tip: How to bump the major version
2020-02-12 13:51:00 -05:00
2022-08-15 10:41:45 -04:00
If you bump the major version, you need to change all the source
files. The last time this was done (v2 -> v3) these two commands
were used. They're included her for reference.
```bash
# Make all the changes:
sed -i.bak -e 's@github .com.StackExchange.dnscontrol.v2@github .com/StackExchange/dnscontrol/v3@g ' go.* $(fgrep -lri --include '*.go' github.com/StackExchange/dnscontrol/v2 *)
# Delete the backup files:
find * -name \* .bak -delete
```
## Tip: How to rebuild flattener
2022-07-20 10:47:06 -04:00
Rebuilding flatter requites go1.17.1 and the gopherjs compiler.
Install go1.17.1:
2022-08-15 10:41:45 -04:00
```shell
2022-07-20 10:47:06 -04:00
go install golang.org/dl/go1.17.1@latest
go1.17.1 download
```
Install gopherjs:
2022-08-15 10:41:45 -04:00
```shell
2022-07-20 10:47:06 -04:00
go install github.com/gopherjs/gopherjs@latest
```
Build the software:
NOTE: GOOS can't be Darwin because GOPHERJS doesn't support it.
2022-08-15 10:41:45 -04:00
```shell
2022-07-21 09:25:10 -04:00
cd docs/flattener
2022-07-20 10:47:06 -04:00
export GOPHERJS_GOROOT="$(go1.17.1 env GOROOT)"
export GOOS=linux
gopherjs build
```
2022-08-15 10:41:45 -04:00
## Tip: How to update modules
2020-02-12 13:51:00 -05:00
2021-04-22 16:07:53 -04:00
List out-of-date modules and update any that seem worth updating:
2020-02-12 13:51:00 -05:00
2022-02-17 18:22:31 +01:00
```bash
2022-01-03 10:02:21 -05:00
go install github.com/oligot/go-mod-upgrade@latest
2021-04-22 16:07:53 -04:00
go-mod-upgrade
go mod tidy
2020-02-12 13:51:00 -05:00
```
2021-04-22 16:07:53 -04:00
OLD WAY:
2020-02-12 13:51:00 -05:00
2022-02-17 18:22:31 +01:00
```bash
2022-01-03 10:02:21 -05:00
go install github.com/psampaz/go-mod-outdated@latest
2021-04-22 16:07:53 -04:00
go list -mod=mod -u -m -json all | go-mod-outdated -update -direct
# If any are out of date, update via:
2022-02-01 14:47:27 -05:00
go get module/path
2020-02-12 13:51:00 -05:00
2021-04-22 16:07:53 -04:00
# Once the updates are complete, tidy up:
2020-02-12 13:51:00 -05:00
go mod tidy
```