metomi / isodatetime

:date: :watch: Python ISO 8601 date time parser and data model/manipulation utilities
GNU Lesser General Public License v3.0
37 stars 20 forks source link

Implement automated release process #177

Closed MetRonnie closed 4 years ago

MetRonnie commented 4 years ago

Closes #171

Automates the release process of http://www-nwp/~fcm/metomi-docs/support/how_to_create_a_git_release.html (written by @wxtim) as much as possible.

Summary of new release process

  1. Go to the Actions tab of the repo and choose the "Release stage 1 - create release PR" workflow

  2. Click the "Run workflow" dropdown and enter the version number in the input field (also the base branch to open the PR against, defaults to master) image

  3. The workflow creates a PR with the changes

    diff --git a/CHANGES.md b/CHANGES.md
    index 3dcb180..97b0587 100644
    --- a/CHANGES.md
    +++ b/CHANGES.md
    @@ -11,7 +11,7 @@ ones in. -->
    
    -## isodatetime 1.0.1 (<span actions:bind='release-date'>Upcoming, 2020</span>)
    +## isodatetime 1.0.1 (<span actions:bind='release-date'>Released 2020-07-28</span>)
    
    diff --git a/metomi/isodatetime/__init__.py b/metomi/isodatetime/__init__.py
    index 362c702..395c18b 100644
    --- a/metomi/isodatetime/__init__.py
    +++ b/metomi/isodatetime/__init__.py
    @@ -17,4 +17,4 @@
    # ----------------------------------------------------------------------------
    """Python ISO 8601 date time parser and data model/manipulation utilities."""
    
    -__version__ = "1.0.0"
    +__version__ = "1.0.1"
  4. It also automatically adds the milestone to the PR if there is one that matches the version number

  5. The body text of the PR has a checklist of non-automatable things to do before merging the PR, as per Tim's guide

  6. The release author requests a review as usual

  7. If any changes are needed, they can be pushed to the PR branch

  8. After approval and merge of the PR, a second workflow automatically publishes to PyPI, and publishes a GitHub release

  9. It also posts a comment on the PR with the outcome with a link to the GitHub release so the author can edit the description (or with instructions to manually publish if the publishing failed for some reason)

  10. It also automatically deletes the PR branch, and closes the milestone if it was added

Demo

https://github.com/MetRonnie/pls/pull/18

Advantages of this approach


Things left to do:

MetRonnie commented 4 years ago

Also, here is a demo where the stage 2 - publish workflow fails: https://github.com/MetRonnie/pls/pull/15

oliver-sanders commented 4 years ago

Document this new release process somewhere - here on the repo, or in the Metomi docs site?

Stick in a PR to: https://github.com/cylc/cylc-admin/blob/master/docs/howto/create-a-release.md