Skip to content

Commit f2de476

Browse files
authored
Merge pull request #215 from robbat2/robbat2/release-process
build: document & improve release process
2 parents fe20d21 + 8653a81 commit f2de476

File tree

3 files changed

+113
-6
lines changed

3 files changed

+113
-6
lines changed

Docker.autogen

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUN apt update && \
55
automake \
66
gettext \
77
libtool \
8+
gawk \
89
pkg-config
910
VOLUME /workdir
1011
ENTRYPOINT cd /workdir && /bin/sh autogen.sh && ./configure -C && make distclean

Makefile.am

+23-6
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,41 @@ EXTRA_DIST = \
194194
.travis.yml
195195

196196
EXTENSIONS = gz bz2 lz lzma xz tarZ shar zip
197-
HASHES = sha1 sha256 sha512
197+
HASHES = sha256 sha512
198198

199+
# Generate clearsigned checksum files.
200+
# Generate detached signatures of the tarballs.
199201
sign:
200202
$(AM_V_GEN)for e in $(EXTENSIONS); do \
201203
if [ -f radvd-$(VERSION).tar.$$e ]; then \
204+
gpg --armor --sign --detach-sign radvd-$(VERSION).tar.$$e; \
202205
for h in $(HASHES); do \
203-
$${h}sum radvd-$(VERSION).tar.$$e > radvd-$(VERSION).tar.$$e.$$h; \
206+
$${h}sum --tag radvd-$(VERSION).tar.$$e > radvd-$(VERSION).tar.$$e.$$h || exit 1; \
207+
gpg --clear-sign radvd-$(VERSION).tar.$$e.$$h || exit 1; \
208+
mv -f radvd-$(VERSION).tar.$$e.$$h.asc radvd-$(VERSION).tar.$$e.$$h || exit 1; \
204209
done; \
205-
gpg -sba radvd-$(VERSION).tar.$$e; \
206210
fi; \
207211
done
208212

213+
# Verify clearsigned checksum files.
214+
# Verify detached signatures of the tarballs.
215+
#
216+
# Be careful to verify the clearsign, take ONLY the signed part, and then
217+
# verify the checksum contained in that (ignore checksums OUTSIDE the
218+
# clearsigned part).
209219
verify:
210220
$(AM_V_GEN)for e in $(EXTENSIONS); do \
211221
if [ -f radvd-$(VERSION).tar.$$e ]; then \
222+
gpg --verify radvd-$(VERSION).tar.$$e.asc; \
212223
for h in $(HASHES); do \
213-
$${h}sum -c radvd-$(VERSION).tar.$$e.$$h; \
224+
rm -f radvd-$(VERSION).tar.$$e.$$h.verified || exit 1; \
225+
gpg --output radvd-$(VERSION).tar.$$e.$$h.verified --verify radvd-$(VERSION).tar.$$e.$$h || exit 1; \
226+
if ! $${h}sum -c radvd-$(VERSION).tar.$$e.$$h.verified ; then \
227+
rm -f radvd-$(VERSION).tar.$$e.$$h.verified; \
228+
exit 1; \
229+
fi; \
230+
rm -f radvd-$(VERSION).tar.$$e.$$h.verified; \
214231
done; \
215-
gpg --verify radvd-$(VERSION).tar.$$e.asc; \
216232
fi; \
217233
done
218234

@@ -233,6 +249,8 @@ html:
233249

234250
packages:
235251
@if [[ "$$(git diff | wc -l)" != "0" ]] ; then printf "\n\n\tYou have local changes in the working copy...\n\n\n" && git diff && false ; fi
252+
@if [[ "$$(git rev-parse HEAD)" != "$$(git rev-parse v$(VERSION)^{commit})" ]] ; then printf "\n\n\tv$(VERSION) tag missing, or not checked out...\n\n\n" && false ; fi
253+
rm -f radvd-$(VERSION).tar*
236254
$(MAKE) dist-gzip
237255
rm -rf radvd-$(VERSION)
238256
tar zfx radvd-$(VERSION).tar.gz
@@ -242,7 +260,6 @@ packages:
242260
$(MAKE) sign
243261
$(MAKE) verify
244262
$(MAKE) html
245-
@if [[ "$$(git rev-parse HEAD)" != "$$(git rev-parse v$(VERSION))" ]] ; then printf "\n\n\tv$(VERSION) tag missing, or not checked out...\n\n\n" && false ; fi
246263
@printf "\n\n\tDont forget to push the v$(VERSION) tag and this branch to origin (git push origin v$(VERSION) master)\n\n\n"
247264

248265

RELEASE-PROCESS.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Rough release process
2+
3+
## Update `CHANGES`
4+
5+
Go through `git log` and ensure that each relevant change is documented in
6+
the `CHANGES file.
7+
8+
## Ensure version consistency
9+
10+
The version identifier needs to be consistent amongst the `CHANGES` file, the
11+
`configure.ac` file, and the git tag. First, determine the currently-configured
12+
version identifier, such as by running:
13+
14+
```
15+
grep AC_INIT configure.ac | cut -d[ -f 2 | cut -d] -f 1
16+
grep Release CHANGES | head -1
17+
```
18+
19+
When preparing a release candidate build, the version string should end with
20+
`_rcN`, where N is the candidate build number.
21+
22+
Conventionally, the `CHANGES` file will contain a string in the format
23+
`v<version>`, such as `v2.20_rc1` or `v2.20`, while the git tag and
24+
`configure.ac` file will contain a string in the format `<version>`, such as
25+
`2.20_rc1` or `2.20.`
26+
27+
Edit the `CHANGES` file and note the new version identifier.
28+
29+
## Update `configure.ac`
30+
31+
After manually updating the `CHANGES` file, update the `configure.ac` file
32+
with a matching version identifier, such as:
33+
34+
```
35+
export VERSION="$(grep Release CHANGES | head -1 | sed s/'.*Release v'//g)"
36+
echo "New version identifier is: $VERSION"
37+
sed -i -e "/^AC_INIT/s,\[.*\],[$VERSION],g" configure.ac
38+
```
39+
40+
## Validate, commit, and tag
41+
42+
Next, examine the changes to ensure accuracy:
43+
44+
```
45+
git diff CHANGES configure.ac
46+
```
47+
48+
If everything looks good, commit the changes and create the tag. Note that
49+
this will create a signed tag, so ensure that you have GPG configured
50+
appropriately.
51+
52+
```
53+
git commit -s -m "Release ${VERSION}" CHANGES configure.ac
54+
git tag -s v${VERSION} -m "$VERSION"
55+
```
56+
57+
## Build release archives
58+
59+
### Clean up Docker environment
60+
61+
To build the release archives, first delete the container manually to ensure
62+
the build works with a clean container (this command may fail if hte container
63+
does not exist):
64+
65+
```
66+
docker rmi radvd-autogen:latest
67+
```
68+
69+
### Perform a package build
70+
71+
The `autogen-container.sh` script will run `autoreconf` in a clean environment.
72+
Afterward, the `./configure` script can be run in order to configure the build
73+
environment. Finally, `make packages` will create package archives suitable
74+
for release.
75+
76+
```
77+
./autogen-container.sh
78+
./configure
79+
make packages
80+
```
81+
82+
### Release the new version on GitHub
83+
84+
To perform this step, first install and configure the
85+
[GitHub CLI](https://cli.github.com/).
86+
87+
```
88+
gh release create v${VERSION} radvd-${VERSION}.tar.{xz,gz}{,.asc,.sha256,.sha512}`
89+
```

0 commit comments

Comments
 (0)