Skip to content

Conversation

cjolowicz
Copy link
Owner

@cjolowicz cjolowicz commented Nov 15, 2020

The intended workflow is as follows:

export GITHUB_TOKEN=<secret>

nox -rs prepare-release
# Edit pull request description on GitHub...
nox -rs publish-release

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. The publish-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.

@cjolowicz cjolowicz added the cookiecutter Changes outside of the template directory label Nov 15, 2020
@cjolowicz cjolowicz force-pushed the release-automation branch 3 times, most recently from bc89c24 to b7e7d20 Compare November 15, 2020 17:49
@cjolowicz cjolowicz marked this pull request as draft November 15, 2020 18:04
@cjolowicz cjolowicz force-pushed the release-automation branch 2 times, most recently from ff83d3c to b2ece68 Compare November 15, 2020 20:23
@cjolowicz cjolowicz added the ci Changes to CI configuration files and scripts label Nov 15, 2020
@cjolowicz cjolowicz changed the title Add tools to automate Cookiecutter releases WIP: Add tools to automate Cookiecutter releases Nov 15, 2020
@cjolowicz cjolowicz added this to the Backlog milestone Nov 15, 2020
@cjolowicz cjolowicz marked this pull request as ready for review January 29, 2021 12:15
@cjolowicz cjolowicz changed the title WIP: Add tools to automate Cookiecutter releases Add tools to automate Cookiecutter releases Jan 29, 2021
@cjolowicz cjolowicz merged commit 9b0450e into master Jan 29, 2021
@cjolowicz cjolowicz deleted the release-automation branch January 29, 2021 12:19
@cjolowicz cjolowicz mentioned this pull request Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes to CI configuration files and scripts cookiecutter Changes outside of the template directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant