2017-10-11 20:33:17 +08:00
---
layout: default
title: How to build and ship a release
---
2017-08-24 23:32:51 +08:00
# How to build and ship a release
2017-11-03 05:51:52 +08:00
2017-10-03 03:10:26 +08:00
Here are my notes from producing the v0.2.2 release. Change the version number as appropriate.
2017-08-24 23:32:51 +08:00
2017-10-24 21:42:30 +08:00
## Step 1. Run the integration tests
2017-11-03 05:51:52 +08:00
2017-10-03 01:53:01 +08:00
* If you are at StackOverflow, this is in TC as "DNS > Integration Tests".
* Otherwise:
* Run "go test" (documented in [Creating new DNS Resource Types ](adding-new-rtypes ))
* Run the integration tests (documented in [Writing new DNS providers ](writing-providers )
2017-08-24 23:32:51 +08:00
2017-11-03 05:51:52 +08:00
2017-08-24 23:32:51 +08:00
## Step 2. Bump the verison number
2017-11-03 05:51:52 +08:00
2017-08-24 23:32:51 +08:00
Edit the "Version" variable in `main.go` and commit.
```
2018-01-23 10:21:33 +08:00
export PREVVERSION=2.4
export VERSION=2.5
2017-12-07 06:03:07 +08:00
git checkout master
2017-08-24 23:32:51 +08:00
vi main.go
2018-01-23 10:21:33 +08:00
git commit -m'Release v'"$VERSION" main.go
git tag v0."$VERSION"
git push origin tag v0."$VERSION"
2017-08-24 23:32:51 +08:00
```
## Step 3. Make the draft release.
2017-11-03 05:51:52 +08:00
2017-08-24 23:32:51 +08:00
[On github.com, click on "Draft a new release" ](https://github.com/StackExchange/dnscontrol/releases/new )
2018-01-23 10:21:33 +08:00
Pick the v0.$VERSION tag
2017-08-24 23:32:51 +08:00
2018-01-23 10:21:33 +08:00
Release title: Release v0.$VERSION
2017-08-24 23:32:51 +08:00
Fill in the text box with something friendly like, "So many new features!" then make a bullet list of major new functionality.
Review the git log using this command:
2018-01-23 10:21:33 +08:00
git log v0."$VERSION"...v0."$PREVVERSION"
2017-08-24 23:32:51 +08:00
2018-03-17 01:07:42 +08:00
(Don't click SAVE until the next step is complete!)
2017-12-07 06:01:16 +08:00
2017-08-24 23:32:51 +08:00
Create the binaries and attach them to the release:
2017-08-30 01:49:39 +08:00
go run build/build.go
2017-08-24 23:32:51 +08:00
NOTE: This command creates binaries with the version number and git hash embedded. It also builds the releases for all supported platforms (i.e. creates a .exe for Windows even if you are running on Linux. Isn't Go amazing?)
2017-10-03 03:10:26 +08:00
WARNING: if there are unchecked in files, the version string will have "dirty" appended.
2017-08-24 23:32:51 +08:00
This is what it looks like when you did it right:
```
$ ./dnscontrol-Darwin version
2017-08-25 00:04:33 +08:00
dnscontrol 0.1.5 ("6fdf78997815055bbe119c0116c9e2d60310a515") built 24 Aug 17 11:26 EDT
2017-08-24 23:32:51 +08:00
```
This is what it looks like when there was a file that should have been checked in:
```
$ ./dnscontrol-Darwin version
dnscontrol 0.1.5 ("6fdf78997815055bbe119c0116c9e2d60310a515[dirty]") built 24 Aug 17 11:27 EDT
^^^^^
^^^^^ See?
^^^^^
```
## Step 4. Attach the binaries and release.
2017-11-03 05:51:52 +08:00
2017-08-24 23:32:51 +08:00
Drag and drop binaries into the web form.
Submit the release.
2017-11-03 07:35:08 +08:00
## Step 5. Announce it via email
2017-11-03 05:51:52 +08:00
2017-08-24 23:32:51 +08:00
Email the mailing list: (note the format of the Subject line and that the first line of the email is the URL of the release)
```
To: dnscontrol-discuss@googlegroups.com
2018-01-23 10:21:33 +08:00
Subject: New release: dnscontrol v0.$VERSION
2017-08-24 23:32:51 +08:00
2018-01-23 10:21:33 +08:00
https://github.com/StackExchange/dnscontrol/releases/tag/v0.$VERSION
2017-08-24 23:32:51 +08:00
So many new providers and features! Plus, a new testing framework that makes it easier to add big features without fear of breaking old ones.
* list
2017-08-30 01:49:39 +08:00
* of
2017-08-24 23:32:51 +08:00
* major
* changes
```
2017-11-03 07:35:08 +08:00
## Step 6. Announce it via chat
Mention on [https://gitter.im/dnscontrol/Lobby ](https://gitter.im/dnscontrol/Lobby ) that the new release has shipped.
```
2018-01-23 10:21:33 +08:00
dnscontrol $VERSION has been released! https://github.com/StackExchange/dnscontrol/releases/tag/v0.$VERSION
2017-11-03 07:35:08 +08:00
```
## Step 7. Get credit!
2017-11-03 05:51:52 +08:00
Mention the fact that you did this release in your weekly accomplishments.
2018-03-17 01:07:42 +08:00
If you are at Stack Overflow:
* Add the release to your weekly snippets
* Run this build: `dnscontrol_embed - Promote most recent artifact into ExternalDNS repo`