Add tools to automate Cookiecutter releases #674
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The intended workflow is as follows:
Releases require some changes to the documentation, and we always hand-edit the draft release before publishing. So we cannot release the Cookiecutter simply by publishing the automated draft release. Instead, the
prepare-release
session creates a PR with all required changes, and copies the release notes from the draft release into the pull request description. Thepublish-release
session merges the PR, copies the release notes back into the draft release, and publishes the release.There is a race condition with Release Drafter here, which will also attempt to update the draft release when the PR is merged. Unfortunately, there is no obvious way to skip the workflow when the release branch is merged. Under normal conditions, the Nox session will have published the release before the Release Drafter workflow spins up, so the workflow will simply create a new empty draft release. IIUC setting the release notes and publishing the release happens in a single transaction, so we're not going to publish a draft release without the edits from the pull request. In the unlikely case that the workflow updates the draft release first, the Nox session will overwrite its changes, and the results will be the same.