diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
new file mode 100644
index 00000000..8c4cde37
--- /dev/null
+++ b/.github/release-drafter.yml
@@ -0,0 +1,66 @@
+exclude-labels:
+ # When PR will not be classified if it has these labels
+ - skip changelog
+ - release
+name-template: 'Sparse v$RESOLVED_VERSION'
+
+change-template: '- $TITLE (#$NUMBER)'
+
+autolabeler:
+ - label: breaking
+ title:
+ # Example: feat!: ...
+ - '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*\))?\!\: /'
+ - label: build
+ title:
+ - '/^(build)/'
+ - label: internal
+ title:
+ - '/^(chore|ci|refactor|test)/'
+ - label: deprecation
+ title:
+ - '/^depr/'
+ - label: documentation
+ title:
+ - '/^(docs|docstring)/'
+ - label: enhancement
+ title:
+ - '/^feat/'
+ - label: fix
+ title:
+ - '/^fix/'
+ - label: performance
+ title:
+ - '/^perf/'
+ - label: release
+ title:
+ - '/^release/'
+ - label: 'skip changelog'
+ title:
+ - '/^\[pre-commit.ci\]/'
+categories:
+ - title: Highlights
+ labels: highlight
+ - title: Breaking changes
+ labels:
+ - breaking
+ - breaking python
+ - title: Deprecations
+ labels: deprecation
+ - title: Performance improvements
+ labels: performance
+ - title: Enhancements
+ labels: enhancement
+ - title: Bug fixes
+ labels: fix
+ - title: Documentation
+ labels: documentation
+ - title: Build system
+ labels: build
+ - title: Other improvements
+ labels: internal
+
+template: |
+ ## Changes
+
+ $CHANGES
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
new file mode 100644
index 00000000..4dc7b6b5
--- /dev/null
+++ b/.github/workflows/release-drafter.yml
@@ -0,0 +1,40 @@
+name: Release Drafter
+
+on:
+ push:
+ # branches to consider in the event; optional, defaults to all
+ branches:
+ - main
+ # pull_request event is required only for autolabeler
+ pull_request:
+ # Only following types are handled by the action, but one can default to all as well
+ types: [opened, reopened, synchronize, edited]
+ # pull_request_target event is required for autolabeler to support PRs from forks
+ pull_request_target:
+ types: [opened, reopened, synchronize, edited]
+
+permissions:
+ contents: read
+
+jobs:
+ update_release_draft:
+ permissions:
+ # write permission is required to create a github release
+ contents: write
+ # write permission is required for autolabeler
+ # otherwise, read permission is required at least
+ pull-requests: write
+ runs-on: ubuntu-latest
+ steps:
+ # (Optional) GitHub Enterprise requires GHE_HOST variable set
+ #- name: Set GHE_HOST
+ # run: |
+ # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
+
+ # Drafts your next Release notes as Pull Requests are merged into "main"
+ - uses: release-drafter/release-drafter@v6
+ # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
+ # with:
+ # config-name: my-config.yml
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/docs/contributing.md b/docs/contributing.md
index 1f606161..448e9f3a 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -47,6 +47,17 @@ after forking and cloning the repository:
pip install -e .[all]
```
+## Pull requests
+
+Please adhere to the following guidelines:
+
+1. Start your pull request title with a [conventional commit](https://www.conventionalcommits.org/) tag. This helps us add your contribution to the right section of the changelog. We use "Type" from the [Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type).
+ TLDR:
+ The PR title should start with any of this abbreviatons: `build`, `chore`, `ci`, `depr`,
+ `docs`, `feat`, `fix`, `perf`, `refactor`, `release`, `test`. Add a `!`at the end, if it is a breaking change. For example `refactor!`.
+2. This text will end up in the changelog.
+3. Please follow the instructions in the pull request form and submit.
+
## Running/Adding Unit Tests
It is best if all new functionality and/or bug fixes have unit tests added
diff --git a/release-procedure.md b/release-procedure.md
index 047e11ea..cd78e21b 100644
--- a/release-procedure.md
+++ b/release-procedure.md
@@ -1,5 +1,3 @@
-* Update changelog in docs/changelog.rst and commit.
-
* Tag commit
```bash
git tag -a x.x.x -m 'Version x.x.x'
@@ -9,6 +7,7 @@
```bash
git push pydata main --tags
```
+ When you open the PR on GitHub, make sure the title of the PR starts with "release".
* Upload to PyPI
```bash
@@ -17,6 +16,14 @@
twine upload dist/* # upload packages
```
+* Update the release drafter:
+ Go to https://github.com/pydata/sparse
+ Under the “Release" section there are two links: One is the latest release (it has a tag).
+ The second one is +. Click on the second one so you can see the release drafter.
+ Edit the draft by clicking the "pencil" figure.
+ Make sure you have the correct tags. If they are not, you can create one.
+ If the markdown page looks correct, click on “Publish release”.
+
* Enable the newly-pushed tag for documentation: https://readthedocs.org/projects/sparse-nd/versions/
* Wait for conda-forge to realise that the build is too old and make a PR.
* Edit and merge that PR.