mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Automate releng a bit more (#1006)
This commit is contained in:
69
bin/make-release.sh
Executable file
69
bin/make-release.sh
Executable file
@ -0,0 +1,69 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo -e
|
||||||
|
|
||||||
|
: "${1:?'Provide the version number as the first arg (v1.2.3, not 1.2.3).'}" ;
|
||||||
|
|
||||||
|
NEWVERSION="$1"
|
||||||
|
if [[ "$NEWVERSION" != v* ]]; then
|
||||||
|
echo "Version should start with v: v1.2.3, not 1.2.3."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git tag -d "$NEWVERSION"
|
||||||
|
|
||||||
|
PREVVERSION="$(git tag --list '[vV]*' --sort=v:refname |tail -1)"
|
||||||
|
|
||||||
|
echo '=========='
|
||||||
|
echo '== current version:' "$PREVVERSION"
|
||||||
|
echo '== new version:' "$NEWVERSION"
|
||||||
|
|
||||||
|
git checkout -b release_"$NEWVERSION" || true
|
||||||
|
|
||||||
|
sed -i.bak -e 's/Version = ".*"/Version = "'"$NEWVERSION"'"/g' main.go
|
||||||
|
|
||||||
|
git commit -m'Release '"$NEWVERSION" main.go
|
||||||
|
git tag -f "$NEWVERSION"
|
||||||
|
git push --delete origin "$NEWVERSION"
|
||||||
|
git push origin tag "$NEWVERSION"
|
||||||
|
|
||||||
|
echo ======= Creating: draft-notes.txt
|
||||||
|
echo >draft-notes.txt '
|
||||||
|
This release includes many new providers (FILL IN), dozens
|
||||||
|
of bug fixes, and FILL IN.
|
||||||
|
|
||||||
|
Breaking changes:
|
||||||
|
|
||||||
|
* FILL IN
|
||||||
|
|
||||||
|
Major features:
|
||||||
|
|
||||||
|
* FILL IN
|
||||||
|
|
||||||
|
Provider-specific changes:
|
||||||
|
|
||||||
|
* FILL IN
|
||||||
|
|
||||||
|
Other changes and improvements:
|
||||||
|
|
||||||
|
* FILL IN
|
||||||
|
|
||||||
|
|
||||||
|
'
|
||||||
|
git log "$NEWVERSION"..."$PREVVERSION" >>draft-notes.txt
|
||||||
|
|
||||||
|
git push --set-upstream origin "release_$NEWVERSION"
|
||||||
|
|
||||||
|
echo "NEXT STEP:
|
||||||
|
|
||||||
|
1. Create a PR:
|
||||||
|
open \"https://github.com/StackExchange/dnscontrol/compare/master...release_$NEWVERSION\"
|
||||||
|
|
||||||
|
2. Edit draft-notes.txt into actual release notes.
|
||||||
|
|
||||||
|
3. Verify tests complete successfully.
|
||||||
|
|
||||||
|
4. Merge the PR when satisfied.
|
||||||
|
|
||||||
|
5. Promote the release.
|
||||||
|
"
|
@ -19,24 +19,18 @@ go version
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Step 2. Check unit and integration tests
|
## Step 2. Create a new release branch
|
||||||
|
|
||||||
There's a GitHub Actions [workflow](https://github.com/StackExchange/dnscontrol/actions?query=workflow%3Abuild) which builds the code and runs a set of unit and integration tests. Make sure all tests are passing, including the integration tests for all DNS providers.
|
From the "master" branch, run `bin/bin/make-release.sh v1.2.3` where
|
||||||
|
"v1.2.3" should be the release version.
|
||||||
|
|
||||||
|
This will do a few things.
|
||||||
|
|
||||||
## Step 3. Bump the version number
|
1. Tag the current branch locally and remotely.
|
||||||
|
2. Update main.go with the new version string.
|
||||||
Edit the "Version" variable in `pkg/version/version.go` and commit.
|
3. Create a file called draft-notes.txt which you will edit into the
|
||||||
|
release notes.
|
||||||
```
|
4. Print instructions on how to create the release PR.
|
||||||
export PREVVERSION=3.3.0 <<< Change to the previous version
|
|
||||||
export VERSION=3.4.0 <<< Change to the new release version
|
|
||||||
git checkout master
|
|
||||||
vi main.go <<< Change "Version" to new release version
|
|
||||||
git commit -m'Release v'"$VERSION" main.go
|
|
||||||
git tag v"$VERSION"
|
|
||||||
git push origin tag v"$VERSION"
|
|
||||||
```
|
|
||||||
|
|
||||||
NOTE: If you bump the major version, you need to change all the source
|
NOTE: 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
|
files. The last time this was done (v2 -> v3) these two commands
|
||||||
@ -49,13 +43,11 @@ sed -i.bak -e 's@github.com.StackExchange.dnscontrol.v2@github.com/StackExchange
|
|||||||
find * -name \*.bak -delete
|
find * -name \*.bak -delete
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 4. Write the release notes.
|
## Step 3. Write the release notes.
|
||||||
|
|
||||||
The release notes that you write will be used in a few places.
|
The release notes that you write will be used in a few places.
|
||||||
|
|
||||||
To find items to write about, review the git log using this command:
|
draft-notes.txt is just a draft and needs considerable editing.
|
||||||
|
|
||||||
git log v"$VERSION"...v"$PREVVERSION"
|
|
||||||
|
|
||||||
Entries in the bullet list should be phrased in the positive: "Feature
|
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,
|
FOO now does BAR". This is often the opposite of the related issue,
|
||||||
@ -94,7 +86,7 @@ Provider-specific changes:
|
|||||||
* CLOUDFLARE: Fix CF trying to update non-changeable TTL (#issueid)
|
* CLOUDFLARE: Fix CF trying to update non-changeable TTL (#issueid)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 5. Make the draft release.
|
## Step 4. Make the draft release.
|
||||||
|
|
||||||
[On github.com, click on "Draft a new release"](https://github.com/StackExchange/dnscontrol/releases/new)
|
[On github.com, click on "Draft a new release"](https://github.com/StackExchange/dnscontrol/releases/new)
|
||||||
|
|
||||||
@ -112,6 +104,9 @@ Fill in the text box with the release notes written above.
|
|||||||
|
|
||||||
(DO use the "preview" tab to proofread the text.)
|
(DO use the "preview" tab to proofread the text.)
|
||||||
|
|
||||||
|
## Step 5. Merge the release.
|
||||||
|
|
||||||
|
Merge the PR into Master.
|
||||||
|
|
||||||
## Step 6. Publish the release
|
## Step 6. Publish the release
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user