As of the introduction of PR #2409, nightly releases are automatically built on a daily basis. This is accomplished automatically through use of a parameterized invocation of the nightly workflow using CircleCI's Scheduled Pipelines feature.
In the way the schedule is defined, nightly builds are done from the dev branch. However, the functionality that powers nightly builds can be used to also build from any branch (including PRs) and produce a pre-release, "nightly style" build from any desired commit.
This process can only be done by members of the Apollo Router router GitHub repository with contributor permissions on CircleCI.
To invoke a one-off nightly build:
-
Go to the CircleCI Pipelines view for this repository](https://app.circleci.com/pipelines/github/apollographql/router)
-
Click on the "All Branches" drop-down menu and choose a branch you'd like to build from.
-
Press the "Trigger Pipeline" button in the top-right of the navigation (to the left of the "Project Settings" button).
-
Expand the "Add Parameters" section.
-
Add one parameter using the following configuration:
Parameter type:
booleanName:nightlyValue:true -
Press "Trigger Pipeline"
-
Wait a couple seconds for the pipeline to begin and show in the list.
To obtain the binary builds from the pipeline which was launched:
Note Built nightlies are only available on the Artifacts for a job within 30 days after the CircleCI pipeline that created them is finished. If you need them after this period, you will need to re-run the pipeline and wait for it to finish again. You can do this by clicking the "Rerun from start" option on the pipeline.
- Click on the workflow name:
nightlyof the newly launched pipeline. In the above steps, this is the pipeline that appeared after step 7. - Click on the job representing the system architecture you'd like to obtain the build binary for. For example, to get the macOS binary, click on
build_release-macos_build. - If the job hasn't already finished successfully, wait for the job to finish successfully.
- Click on the Artifacts tab.
- Click on the link to the
.tar.gzfile to download the tarball of the build distribution. For example, you might click on a link calledartifacts/router-v0.0.0-nightly-20230119-abcd1234-x86_64-apple-darwin.tar.gzfor a macOS build done on the 19th of January 2023 from commit hash starting withabcd1234.
This is a list of the things that need to happen during a release.
If you are releasing a beta or a release candidate, no official changelog is needed, but you're not off the hook! You'll need to write testing instructions in lieu of an official changelog.
- Open the associated GitHub milestone for the release. All issues and PRs should be closed. If they are not you should reassign all open issues and PRs to future milestones.
- Go through the commit history since the last release. Ensure that all PRs
that have landed are marked with the milestone. You can use this to
show all the PRs that are merged on or after YYYY-MM-DD:
https://github.com/issues?utf8=%E2%9C%93&q=repo%3Aapollographql%2Frouter+merged%3A%3E%3DYYYY-MM-DD - Go through the closed PRs in the milestone. Each should have a changelog label indicating if the change is documentation, feature, fix, or maintenance. If there is a missing label, please add one. If it is a breaking change, also add a BREAKING label.
- Set the release date in
NEXT_CHANGELOG.md. Add this release to theCHANGELOG.md. Use the structure of previous entries.
- Make sure you have
cargoinstalled on your machine and in yourPATH. - Create a new branch "#.#.#" where "#.#.#" is this release's version (release) or "#.#.#-rc.#" (release candidate)
- Update the
versionin*/Cargo.toml(do not forget the ones in scaffold templates). - Update the
apollo-routerGit tags in thedependenciessections of theCargo.tomlfiles inapollo-router-scaffold/templates/**. - Update the
PACKAGE_VERSIONvalue inscripts/install.sh(it should be prefixed withv!) - Update
docker.mdxandkubernetes.mdxwith the release version. - Update
helm/chart/router/Chart.yamlas follows:- update the version and the appVersion to the release version. e.g.:
appVersion: "v0.9.0"8 Updatehelm/chart/router/README.mdby running this from the repo root:(cd helm/chart && helm-docs router). (If not installed, you should installhelm-docs)
- update the version and the appVersion to the release version. e.g.:
- Update the kubernetes section of the docs:
- go to the
helm/chart/routerfolder - run
helm template --set router.configuration.telemetry.metrics.prometheus.enabled=true --set managedFederation.apiKey="REDACTED" --set managedFederation.graphRef="REDACTED" --debug . - Paste the output in the
Kubernetes Configurationexample of thedocs/source/containerization/kubernetes.mdxfile
- Update
federation-version-support.mdxwith the latest version info. Use https://github.com/apollographql/version_matrix to generate the version matrix. - Update the
imageof the Docker image withindocker-compose*.ymlfiles inside thedockerfilesdirectory. - Update the license list with
cargo about generate --workspace -o licenses.html about.hbs. (If not installed, you can installcargo-aboutby runningcargo install cargo-about.) - Add a new section in
CHANGELOG.mdwith the contents ofNEXT_CHANGELOG.md - Put a Release date and the version number on the new
CHANGELOG.mdsection - Update the version in
NEXT_CHANGELOG.md. - Clear
NEXT_CHANGELOG.mdleaving only the template. - Run
cargo checkso the lock file gets updated. - Run
cargo xtask check-compliance. - Push up a commit with all the changes. The commit message should be "release: v#.#.#" or "release: v#.#.#-rc.#"
- Request review from the Router team.
Most review comments will be about the changelog. Once the PR is finalized and approved:
- Always use
Squash and MergeGitHub button.
This part of the release process is handled by CircleCI, and our binaries are distributed as GitHub Releases. When you push a version tag, it kicks off a workflow that checks out the tag, builds release binaries for multiple platforms, and creates a new GitHub release for that tag.
- Wait for tests to pass.
- Have your PR merged to
main. - Once merged, run
git checkout mainandgit pull. - Sync your local tags with the remote tags by running
git tag -d $(git tag) && git fetch --tags - Tag the commit by running either
git tag -a v#.#.# -m "#.#.#"(release), orgit tag -a v#.#.#-rc.# -m "#.#.#-rc.#"(release candidate) - Run
git push --tags. - Wait for CI to pass.
After CI builds the release binaries, a new release will appear on the
releases page, click
Edit, update the release notes, and save the changes to the release.
- Paste the current release notes from
NEXT_CHANGELOG.mdinto the release body. - Reset the content of
NEXT_CHANGELOG.md.
-
CI should already mark the release as a
pre-release. Double check that it's listed as a pre-release on the release'sEditpage. -
If this is a new rc (rc.0), paste testing instructions into the release notes.
-
If this is a rc.1 or later, the old release candidate testing instructions should be moved to the latest release candidate testing instructions, and replaced with the following message:
This beta release is now out of date. If you previously installed this release, you should reinstall and see what's changed in the latest [release](https://github.com/apollographql/router/releases).
The new release candidate should then include updated testing instructions with a small changelog at the top to get folks who installed the old release candidate up to speed.
- To perform these steps, you'll need access credentials which allow you publishing to Crates.io.
- Make sure you are on the Git tag you have published and pushed in the previous step by running
git checkout v#.#.#(release) orgit checkout v#.#.#-rc.#(release candidate). (You are probably still on this commit) - Change into the
apollo-router/directory at the root of the repository. - Make sure that the
README.mdin this directory is up to date with any necessary or relevant changes. It will be published as the crates README on Crates.io. - Run
cargo publish --dry-runif you'd like to smoke test things - Do the real publish with
cargo publish.
Mistakes happen. Most of these release steps are recoverable if you mess up.
Tags and releases can be removed in GitHub. First, remove the remote tag:
git push --delete origin vX.X.XThis will turn the release into a draft and you can delete it from the edit
page.
Make sure you also delete the local tag:
git tag --delete vX.X.X