Skip to content

Commit

Permalink
Add release drafter github action (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Jun 20, 2021
1 parent d8ac360 commit 608572f
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<!--- Describe the changes here. --->

**Changelog-friendly one-liner**: <!-- One-liner description here -->

##### Contributor checklist

- [ ] Provided the tests for the changes.
- [ ] Gave a clear one-line description in the PR (that the maintainers can add to CHANGELOG.md on release).
- [ ] Assure PR title is short, clear, and good to be included in the user-oriented changelog
- [ ] Assure one of these labels is present: `backwards incompatible`, `feature`, `enhancement`, `deprecation`, `bug`, `dependency`, `docs` or `skip-changelog` as they determine changelog listing.
- [ ] Assign the PR to an existing or new milestone for the target version (following [Semantic Versioning](https://blog.versioneye.com/2014/01/16/semantic-versioning/)).
49 changes: 49 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"

categories:
- title: "Backwards Incompatible Changes"
labels:
- "backwards incompatible"

- title: "Features"
labels:
- "feature"
- "enhancement"
# usually combined with enhancement (avoid double listing)
- "deprecation"

- title: "Bug Fixes"
labels:
- "bug"
- "bug fix"

- title: "Other Changes"
labels:
- "dependency"
- "docs"

change-template: "- $TITLE ([#$NUMBER](https://github.com/jazzband/pip-tools/pull/$NUMBER)). Thanks @$AUTHOR"
exclude-labels:
- "skip-changelog"
- "maintenance"
- "trivial"
template: |
$CHANGES
version-resolver:
major:
labels:
- "backwards incompatible"
minor:
labels:
- "feature"
- "enhancement"
- "deprecation"
patch:
labels:
- "bug fix"
- "bug"
- "dependency"
- "docs"
default: minor
22 changes: 22 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release-drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
- "releases/**"
- "stable/**"

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
if: github.repository == 'jazzband/pip-tools'
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ To help keeping track of the releases and their changes, here's the current rele

- Check to see if any recently merged PRs are missing from the milestone of the version about to be released.
- Create a branch for the release. _Ex: release-3.4.0_.
- Update the [CHANGELOG](CHANGELOG.md) with the version, date and using the one-line descriptions
from the PRs included in the milestone of the version.
Check the previous release changelog format for an example. Don't forget the "Thanks @contributor" mentions.
- Update the [CHANGELOG](CHANGELOG.md) with the version, date and add the text from [drafter release](https://github.com/jazzband/pip-tools/releases).
- Push the branch to your fork and create a pull request.
- Merge the pull request after the changes being approved.
- Make sure that the tests/CI still pass.
- Once ready, go to `Github pip-tools Homepage > releases tab > Draft a new release` and type in:
- _Tag version:_ The exact version number, following [Semantic Versioning](https://blog.versioneye.com/2014/01/16/semantic-versioning/). _Ex: 3.4.0_
- _Target:_ master. As a general rule, the HEAD commit of the master branch should be the release target.
- _Release title:_ Same as the tag. _Ex: 3.4.0_
- _Describe this release:_ Copy of this release's changelog segment.
- Publish release. This will push a tag on the HEAD of master, trigger the CI pipeline and
deploy a pip-tools release in the **Jazzband private package index** upon success.
- The pip-tools "lead" project members will receive an email notification to review the release and
Expand Down

0 comments on commit 608572f

Please sign in to comment.