From 7736a0942a1cb55025eb8352ae324e0d207dad21 Mon Sep 17 00:00:00 2001 From: Dominic Barnes Date: Wed, 20 Sep 2023 14:44:19 -0700 Subject: [PATCH] update release process to use github releases (#2) --- .github/workflows/publish.yml | 5 ++-- CHANGES.md | 10 -------- DEVELOPERS.md | 43 ++++++++++++----------------------- 3 files changed, 16 insertions(+), 42 deletions(-) delete mode 100644 CHANGES.md diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b1ab4b8a..ef609f1f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,8 @@ name: publish on: - push: - tags: - - '*.*.*' # only match semver tags + release: + types: [published] jobs: pypi: diff --git a/CHANGES.md b/CHANGES.md deleted file mode 100644 index c6d7855f..00000000 --- a/CHANGES.md +++ /dev/null @@ -1,10 +0,0 @@ - -0.0.2 / 2023-09-13 -================== - - * docs: add readme to pyproject.toml - -0.0.1 / 2023-09-13 -================== - - * Initial commit diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 4abd10a2..3196740b 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -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/": + +```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 | |-----------------------------|:-------------:|:-----:|:------:|:------:| @@ -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 @@ -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 -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 -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 " (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 \ No newline at end of file +Once published, a GitHub Actions workflow will take care of publishing the new release to PyPI. \ No newline at end of file