For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to build and ship a release

How to build and ship a release

These are the instructions for producing a release.

GitHub Actions (GHA) will do most of the work for you. You will need to edit the draft release notes and click a button to make the release public.

Please change the version number as appropriate. Substitute (for example) v4.2.0 any place you see $VERSION in this doc.

Step 1. Verify everything is up to date

This script will run bin/generate-all.sh and prompt to upgrade depenencies. It must be run from branch main or prep_release.

git checkout main
git config remote.origin.prune true ; git config fetch.prune true
git pull --rebase --ff-only --prune
bin/prep_release.sh

Manual

Dependencies:

git checkout main
git checkout -b update_deps
go install github.com/oligot/go-mod-upgrade@latest
go-mod-upgrade
go mod tidy
git commit -m "CHORE: Update dependencies" go.sum go.mod

Generated files, linting, etc:

Step 2. Cut the release

Pick the next release number:

The manual dance below (empty PR → wait for tests → merge → tag) is now done by creating an empty "release" PR, then a single GitHub Actions run.

Create an empty PR for the release

git fetch origin main git checkout main git config remote.origin.prune true ; git config fetch.prune true git pull --rebase --ff-only --prune git reset --hard origin/main git checkout -b "release_$VERSION" git commit --allow-empty -m "Release $VERSION" git push gh pr create --base main --title "Release $VERSION" --body ""

Wait to tests to complete and merge.

WAIT for the GHA to complete. If there are errors, stop and fix them.

Merge it either manually or with this command:

Create the release

Soon after GitHub will start an Action Workflow called "draft release" which will build all release binaries and write the draft release notes.

Wait to tests to complete and merge.

WAIT for the GHA to complete. If there are errors, stop and fix them.

Release it to the public

Find the release https://github.com/DNSControl/dnscontrol/releases and edit the notes.

When you submit it:

  • "Pre-Release" for rc releases, "Latest" for real releases.

  • Create a discussion for this release

NOTE: You won't be able to post to the mailing list unless you are on it. Click here to join.

Tip: How to bump the major version

If you bump the major version, you need to change all the source files. The last time this was done (v3 -> v4) these two commands were used. They're included her for reference.

Tip: Configuring GHA integration tests

Overview

GHA is configured to run an integration test for any provider listed in the "provider" list. However the test is skipped if the *_DOMAIN variable is not set. For example, the Google Cloud provider integration test is only run if GCLOUD_DOMAIN is set.

  • Q: What labels control the integration tests?

  • A: A PR only runs a "smoke test" (the first few tests). Add the label "fulltest" to run all tests. (The daily run of integration tests on the main branch always does all test.)

  • Q: Where are non-secret environment variables stored?

  • A: GHA calls them "Variables". Update them here: https://github.com/DNSControl/dnscontrol/settings/variables/actions

  • Q: Where are SECRET environment variables stored?

  • A: GHA calls them "Secrets". Update them here: https://github.com/DNSControl/dnscontrol/settings/secrets/actions

How do I add a single new integration test?

  1. Ensure the provider has an entry in integrationTest/profiles.json.

  2. Set the FOO_DOMAIN variables in GHA via https://github.com/DNSControl/dnscontrol/settings/variables/actions

  3. All other variables should be stored as secrets (for consistency). Add them to the integration-tests section of .github/workflows/pr_integration_tests.yml. Set them in GHA via https://github.com/DNSControl/dnscontrol/settings/secrets/actions

How do I add a "bring your own keys" integration test?

Overview: You will fork the repo and add any secrets to your fork. For security reasons you won't have access to the secrets from the main repository.

  1. Fork DNSControl/dnscontrol in GitHub.

    If you already have a fork, be sure to use the "sync fork" button on the main page to sync with the upstream.

  2. In your fork, set the ${DOMAIN}_DOMAIN variable in GHA via Settings :: Secrets and variables :: Actions :: Variables.

  3. In your fork, set any secrets in GHA via Settings :: Secrets and variables :: Actions :: Secrets.

  4. Start a build

Tip: How to rebuild flattener

Rebuilding flatter requires go1.17.1 and the gopherjs compiler.

Install go1.17.1:

Install GopherJS:

Build the software:

NOTE: GOOS can't be Darwin because GOPHERJS doesn't support it.

Tip: How to update modules

List out-of-date modules and update any that seem worth updating:

OLD WAY:

Tip: How to test GoReleaser

(These are random notes)

DO NOT PUSH THIS TAG. It should stay local. If you push it, GHA will build a release!

When done, delete the tag with:

Review output for homebrew/docker logs:

Last updated