Skip to content

Commit a09268f

Browse files
authored
ci: Adding release drafter (#719)
* Adding release drafter for more information, see https://pre-commit.ci * Added instructions to contributing.md * Added instructions for releaser for more information, see https://pre-commit.ci * PR title
1 parent 18079ea commit a09268f

File tree

4 files changed

+126
-2
lines changed

4 files changed

+126
-2
lines changed

.github/release-drafter.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
exclude-labels:
2+
# When PR will not be classified if it has these labels
3+
- skip changelog
4+
- release
5+
name-template: 'Sparse v$RESOLVED_VERSION'
6+
7+
change-template: '- $TITLE (#$NUMBER)'
8+
9+
autolabeler:
10+
- label: breaking
11+
title:
12+
# Example: feat!: ...
13+
- '/^(build|chore|ci|depr|docs|feat|fix|perf|refactor|release|test)(\(.*\))?\!\: /'
14+
- label: build
15+
title:
16+
- '/^(build)/'
17+
- label: internal
18+
title:
19+
- '/^(chore|ci|refactor|test)/'
20+
- label: deprecation
21+
title:
22+
- '/^depr/'
23+
- label: documentation
24+
title:
25+
- '/^(docs|docstring)/'
26+
- label: enhancement
27+
title:
28+
- '/^feat/'
29+
- label: fix
30+
title:
31+
- '/^fix/'
32+
- label: performance
33+
title:
34+
- '/^perf/'
35+
- label: release
36+
title:
37+
- '/^release/'
38+
- label: 'skip changelog'
39+
title:
40+
- '/^\[pre-commit.ci\]/'
41+
categories:
42+
- title: Highlights
43+
labels: highlight
44+
- title: Breaking changes
45+
labels:
46+
- breaking
47+
- breaking python
48+
- title: Deprecations
49+
labels: deprecation
50+
- title: Performance improvements
51+
labels: performance
52+
- title: Enhancements
53+
labels: enhancement
54+
- title: Bug fixes
55+
labels: fix
56+
- title: Documentation
57+
labels: documentation
58+
- title: Build system
59+
labels: build
60+
- title: Other improvements
61+
labels: internal
62+
63+
template: |
64+
## Changes
65+
66+
$CHANGES

.github/workflows/release-drafter.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- main
8+
# pull_request event is required only for autolabeler
9+
pull_request:
10+
# Only following types are handled by the action, but one can default to all as well
11+
types: [opened, reopened, synchronize, edited]
12+
# pull_request_target event is required for autolabeler to support PRs from forks
13+
pull_request_target:
14+
types: [opened, reopened, synchronize, edited]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
update_release_draft:
21+
permissions:
22+
# write permission is required to create a github release
23+
contents: write
24+
# write permission is required for autolabeler
25+
# otherwise, read permission is required at least
26+
pull-requests: write
27+
runs-on: ubuntu-latest
28+
steps:
29+
# (Optional) GitHub Enterprise requires GHE_HOST variable set
30+
#- name: Set GHE_HOST
31+
# run: |
32+
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
33+
34+
# Drafts your next Release notes as Pull Requests are merged into "main"
35+
- uses: release-drafter/release-drafter@v6
36+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
37+
# with:
38+
# config-name: my-config.yml
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/contributing.md

+11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ after forking and cloning the repository:
4747
pip install -e .[all]
4848
```
4949

50+
## Pull requests
51+
52+
Please adhere to the following guidelines:
53+
54+
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).<br>
55+
TLDR:<br>
56+
The PR title should start with any of this abbreviatons: `build`, `chore`, `ci`, `depr`,
57+
`docs`, `feat`, `fix`, `perf`, `refactor`, `release`, `test`. Add a `!`at the end, if it is a breaking change. For example `refactor!`.
58+
2. This text will end up in the changelog.
59+
3. Please follow the instructions in the pull request form and submit.
60+
5061
## Running/Adding Unit Tests
5162

5263
It is best if all new functionality and/or bug fixes have unit tests added

release-procedure.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
* Update changelog in docs/changelog.rst and commit.
2-
31
* Tag commit
42
```bash
53
git tag -a x.x.x -m 'Version x.x.x'
@@ -9,6 +7,7 @@
97
```bash
108
git push pydata main --tags
119
```
10+
When you open the PR on GitHub, make sure the title of the PR starts with "release".
1211

1312
* Upload to PyPI
1413
```bash
@@ -17,6 +16,14 @@
1716
twine upload dist/* # upload packages
1817
```
1918

19+
* Update the release drafter:
20+
Go to https://github.com/pydata/sparse
21+
Under the “Release" section there are two links: One is the latest release (it has a tag).
22+
The second one is +<number of releases>. Click on the second one so you can see the release drafter.
23+
Edit the draft by clicking the "pencil" figure.
24+
Make sure you have the correct tags. If they are not, you can create one.
25+
If the markdown page looks correct, click on “Publish release”.
26+
<br>
2027
* Enable the newly-pushed tag for documentation: https://readthedocs.org/projects/sparse-nd/versions/
2128
* Wait for conda-forge to realise that the build is too old and make a PR.
2229
* Edit and merge that PR.

0 commit comments

Comments
 (0)