Skip to content

Commit 5f978c8

Browse files
weiji14seisman
andauthored
Simplify PyGMT Release process (#446)
Add release checklist template modelled on upstream GMT. Add Release Drafter Github Action that automatically keeps a running changelog at https://github.com/GenericMappingTools/pygmt/releases every time a Pull Request is merged with a tagged label. Made sure to document this release-drafter tool in MAINTENANCE.md. Co-authored-by: Dongdong Tian <[email protected]>
1 parent 809a888 commit 5f978c8

File tree

4 files changed

+100
-7
lines changed

4 files changed

+100
-7
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: PyGMT release checklist
3+
about: Checklist for a new PyGMT release.
4+
title: 'Release PyGMT x.x.x'
5+
labels: 'maintenance'
6+
assignees: ''
7+
8+
---
9+
10+
**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/0.x.x)
11+
**Scheduled Date**: YYYY/MM/DD
12+
13+
**Before release**:
14+
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
15+
- [ ] Update Changelog
16+
17+
**Release**:
18+
- [ ] Make a tag and push it to Github
19+
```
20+
git tag vX.Y.Z
21+
git push --tags
22+
```
23+
- [ ] Go to [GitHub Release](https://github.com/GenericMappingTools/pygmt/releases) and make a release
24+
- [ ] Manually upload the pygmt-vX.Y.Z.zip file to https://zenodo.org/deposit, make sure you file it under the correct reserved DOI
25+
- [ ] Announce the releases on the GMT [forum](https://forum.generic-mapping-tools.org/c/news/), [website](https://github.com/GenericMappingTools/website) (News) and [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools)
26+
27+
**After release**:
28+
- [ ] Create branch 0.x for bug-fixes if this is a minor release (i.e. create branch 0.1 after 0.1.0 is released)
29+
- [ ] Commit changes to Github
30+
31+
**3rd party update**:
32+
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Usually done automatically by conda-forge's bot]
33+
34+
---
35+
36+
- [ ] Party :tada: (don't tick before all other checkboxes are ticked!)

.github/release-drafter.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
categories:
4+
- title: 'New Features'
5+
label: 'feature'
6+
- title: 'Enhancements'
7+
label: 'enhancement'
8+
- title: 'Documentation'
9+
label: 'documentation'
10+
- title: 'Bug Fixes'
11+
label: 'bug'
12+
- title: 'Maintenance'
13+
label: 'maintenance'
14+
- title: 'Deprecations'
15+
label: 'deprecation'
16+
exclude-labels:
17+
- 'skip-changelog'
18+
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
19+
template: |
20+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
21+
22+
## Highlights
23+
24+
*
25+
26+
$CHANGES

.github/workflows/release-drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/[email protected]
15+
with:
16+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
17+
# config-name: my-config.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

MAINTENANCE.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ There are a few steps that still must be done manually, though.
8181

8282
### Updating the changelog
8383

84+
The Release Drafter Github Action will automatically keep a draft changelog at
85+
https://github.com/GenericMappingTools/pygmt/releases, adding a new entry
86+
every time a Pull Request (with a proper label) is merged into the master branch.
87+
This release drafter tool has two configuration files, one for the Github Action
88+
at .github/workflows/release-drafter.yml, and one for the changelog template
89+
at .github/release-drafter.yml. Configuration settings can be found at
90+
https://github.com/release-drafter/release-drafter.
91+
92+
The drafted release notes are not perfect, so we will need to tidy it prior to
93+
publishing the actual release notes at https://www.pygmt.org/latest/changes.html.
94+
8495
1. Generate a list of commits between the last release tag and now:
8596

8697
```bash
@@ -141,17 +152,18 @@ this new folder.
141152
Grab a zip file from the Github release and upload to Zenodo using the previously
142153
reserved DOI.
143154

144-
### Updating the conda package (Not available yet)
155+
### Updating the conda package
156+
157+
When a new version is released on PyPI, conda-forge's bot automatically creates version
158+
updates for the feedstock. In most cases, the maintainers can simply merge that PR.
145159

146-
After Travis is done building the tag and all builds pass, we need to update the conda
147-
package.
148-
Unfortunately, this needs to be done manually for now.
160+
If changes need to be done manually, you can:
149161

150-
1. Fork the feedstock repository (https://github.com/conda-forge/pygmt-feedstock) if
162+
1. Fork the [pygmt feedstock repository](https://github.com/conda-forge/pygmt-feedstock) if
151163
you haven't already. If you have a fork, update it.
152164
2. Update the version number and sha256 hash on `recipe/meta.yaml`. You can get the hash
153165
from the PyPI "Download files" section.
154166
3. Add or remove any new dependencies (most are probably only `run` dependencies).
155-
4. Make a new branch, commit, and push your changes **to your fork**.
167+
4. Make a new branch, commit, and push the changes **to your personal fork**.
156168
5. Create a PR against the original feedstock master.
157-
6. Once the CIs are passing, merge or as a maintainer to do so.
169+
6. Once the CI tests pass, merge the PR or ask a maintainer to do so.

0 commit comments

Comments
 (0)