Skip to content

Commit

Permalink
release: remove old scripts and update process doc
Browse files Browse the repository at this point in the history
- remove prep_release.sh and notes.sample
- update license in release.sh
- add notes for maintainers on the release process
- mention CHANGES file modifications
  • Loading branch information
Rjected committed Aug 12, 2020
1 parent 3db9c7d commit 49f8780
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 216 deletions.
116 changes: 115 additions & 1 deletion release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,84 @@ distinct machines, and end up with a byte-for-byte identical binary. However,
this wasn't _fully_ solved in `go1.13`, as the build system still includes the
directory the binary is built into the binary itself. As a result, our scripts
utilize a work around needed until `go1.13.2`.
Every release should note which Go version was used to build the release, so
that version should be used for verifying the release.

## Building a New Release

### macOS/Linux/Windows (WSL)
### Tagging and pushing a new tag (for maintainers)

Before running release scripts, a few things need to happen in order to finally
create a release and make sure there are no mistakes in the release process.

First, make sure that before the tagged commit there are modifications to the
[CHANGES](../CHANGES) file committed.
The CHANGES file should be a changelog that roughly mirrors the release notes.
Generally, the PRs that have been merged since the last release have been
listed in the CHANGES file and categorized.
For example, these changes have had the following format in the past:
```
Changes in X.YY.Z (Month Day Year):
- Protocol and Network-related changes:
- PR Title One (#PRNUM)
- PR Title Two (#PRNUMTWO)
...
- RPC changes:
- Crypto changes:
...
- Contributors (alphabetical order):
- Contributor A
- Contributor B
- Contributor C
...
```

If the previous tag is, for example, `vA.B.C`, then you can get the list of
contributors (from `vA.B.C` until the current `HEAD`) using the following command:
```bash
git log vA.B.C..HEAD --pretty="%an" | sort | uniq
```
After committing changes to the CHANGES file, the tagged release commit
should be created.

The tagged commit should be a commit that bumps version numbers in `version.go`
and `cmd/btcctl/version.go`.
For example (taken from [f3ec130](https://github.com/btcsuite/btcd/commit/f3ec13030e4e828869954472cbc51ac36bee5c1d)):
```diff
diff --git a/cmd/btcctl/version.go b/cmd/btcctl/version.go
index 2195175c71..f65cacef7e 100644
--- a/cmd/btcctl/version.go
+++ b/cmd/btcctl/version.go
@@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
const (
appMajor uint = 0
appMinor uint = 20
- appPatch uint = 0
+ appPatch uint = 1

// appPreRelease MUST only contain characters from semanticAlphabet
// per the semantic versioning spec.
diff --git a/version.go b/version.go
index 92fd60fdd4..fba55b5a37 100644
--- a/version.go
+++ b/version.go
@@ -18,7 +18,7 @@ const semanticAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
const (
appMajor uint = 0
appMinor uint = 20
- appPatch uint = 0
+ appPatch uint = 1

// appPreRelease MUST only contain characters from semanticAlphabet
// per the semantic versioning spec.
```

Next, this commit should be signed by the maintainer using `git commit -S`.
The commit should be tagged and signed with `git tag <TAG> -s`, and should be
pushed using `git push origin TAG`.

### Building a release on macOS/Linux/Windows (WSL)

No prior set up is needed on Linux or macOS is required in order to build the
release binaries. However, on Windows, the only way to build the release
Expand All @@ -25,6 +99,46 @@ This will then create a directory of the form `btcd-<TAG>` containing archives
of the release binaries for each supported operating system and architecture,
and a manifest file containing the hash of each archive.

### Pushing a release (for maintainers)

Now that the directory `btcd-<TAG>` is created, the manifest file needs to be
signed by a maintainer and the release files need to be published to GitHub.

Sign the `manifest-<TAG>.txt` file like so:
```sh
gpg --sign --detach-sig manifest-<TAG>.txt
```
This will create a file named `manifest-<TAG>.txt.sig`, which will must
be included in the release files later.

#### Note before publishing
Before publishing, go through the reproducible build process that is outlined
in this document with the files created from `release/release.sh`. This includes
verifying commit and tag signatures using `git verify-commit` and git `verify-tag`
respectively.

Now that we've double-checked everything and have all of the necessary files,
it's time to publish release files on GitHub.
Follow [this documentation](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository)
to create a release using the GitHub UI, and make sure to write release notes
which roughly follow the format of [previous release notes](https://github.com/btcsuite/btcd/releases/tag/v0.20.1-beta).
This is different from the [CHANGES](../CHANGES) file, which should be before the
tagged commit in the git history.
Much of the information in the release notes will be the same as the CHANGES
file.
It's important to include the Go version used to produce the release files in
the release notes, so users know the correct version of Go to use to reproduce
and verify the build.
When following the GitHub documentation, include every file in the `btcd-<TAG>`
directory.

At this point, a signed commit and tag on that commit should be pushed to the main
branch. The directory created from running `release/release.sh` should be included
as release files in the GitHub release UI, and the `manifest-<TAG>.txt` file
signature, called `manifest-<TAG>.txt.sig`, should also be included.
A release notes document should be created and written in the GitHub release UI.
Once all of this is done, feel free to click `Publish Release`!

## Verifying a Release

With `go1.13`, it's now possible for third parties to verify release binaries.
Expand Down
6 changes: 0 additions & 6 deletions release/notes.sample

This file was deleted.

205 changes: 0 additions & 205 deletions release/prep_release.sh

This file was deleted.

9 changes: 5 additions & 4 deletions release/release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash

# Copyright (c) 2016 Company 0, LLC.
# Copyright (c) 2016-2020 The btcsuite developers
# Use of this source code is governed by an ISC
# license that can be found in the LICENSE file.

# Simple bash script to build basic btcd tools for all the platforms we support
# with the golang cross-compiler.
#
# Copyright (c) 2016 Company 0, LLC.
# Use of this source code is governed by the ISC
# license.

set -e

Expand Down

0 comments on commit 49f8780

Please sign in to comment.