Skip to content

Commit

Permalink
update release process to use github releases (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Barnes authored Sep 20, 2023
1 parent 8be0d74 commit 7736a09
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 42 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: publish

on:
push:
tags:
- '*.*.*' # only match semver tags
release:
types: [published]

jobs:
pypi:
Expand Down
10 changes: 0 additions & 10 deletions CHANGES.md

This file was deleted.

43 changes: 14 additions & 29 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

## Publishing New Releases

First, determine which semver level to bump. Use this table if you are unsure:
First, create a new release branch, using the naming convention "release/<new version>":

```shell
git checkout -b release/0.1.1
```

Next, determine which semver level to bump. Use this table if you are unsure:

| Resource | Documentation | Add | Update | Remove |
|-----------------------------|:-------------:|:-----:|:------:|:------:|
Expand All @@ -14,7 +20,7 @@ First, determine which semver level to bump. Use this table if you are unsure:
| data model field (optional) | patch | minor | major | major |
| data model field (required) | patch | major | major | major |

Once chosen, use:
Then, execute the following in your release branch.

```shell
poetry version <patch|minor|major>
Expand All @@ -24,31 +30,10 @@ Which will update `pyproject.toml` and print the new version:

> Bumping version from 0.1.0 to 0.1.1
Next, use [git-release] (available via [git-extras]) and pass along the updated version:

```shell
git release <version> -c
```

This will update the changelog and open your `$EDITOR` to review and make any manual changes. Once saved, the tag will
be created and pushed to Github, where the release will automatically be published to PyPI via Github Actions.

### One-Liner

To simplify the steps above, once you've chosen your semver level:

```shell
git release `poetry version <level> -s` -c
```

**NOTE:** the use of `poetry version ... -s` to only output the new version.

For example, to publish a new minor version:

```shell
git release `poetry version minor -s` -c
```

Commit this change and open a Pull Request with your branch. Once approved and merged, create a new release using the
GitHub Releases UI:
- tag: create a new tag using the new version (eg: "0.1.1")
- title: "Release <new version>" (eg: "Release 0.1.1")
- description: click "Generate release notes" to allow GitHub to automate this

[git-extras]: https://github.com/tj/git-extras
[git-release]: https://github.com/tj/git-extras/blob/master/Commands.md#git-release
Once published, a GitHub Actions workflow will take care of publishing the new release to PyPI.

0 comments on commit 7736a09

Please sign in to comment.