Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 23.6.0 #515

Merged
merged 12 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ jobs:


pypi-publish:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
name: Check tag and publish
# Only trigger this for tag changes.
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to additionally set an environment (I use release-pypi myself) which you then configure on PyPI to be the only one that is allowed to publish:

Suggested change
permissions:
environment: release-pypi
permissions:

My understanding is that it gets created automatically when used, but you can also manually add it to https://github.com/twisted/towncrier/settings/environments

Here's a quote from the publisher docs on PyPI:

The name of the GitHub Actions environment that the above workflow uses for publishing. This should be configured under the repository's settings. While not required, a dedicated publishing environment is strongly encouraged, especially if your repository has maintainers with commit access who shouldn't have PyPI publishing access.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I am not sure this is needed.

I hope we can keep the towncrier access security setting simple ... and fully trust anyone with write access to the main repo.

Fork should be ok as the forks should not get access to the GitHub Secrets and I hope PyPI will deny access to the OIDC token from forks :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hynek it looks like using the GHA environment has the unwanted side effect, that any CI run is now blocked and needs manual approval.

I tried to add a high-level conditional, but I see that the deploy request is still triggered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh ok leave it out for now and we’ll look another time. Sorry for the noise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the environment thing is worth exploring ...

I guess that the deployment workflow is designed to be triggered as a side-effect of another workflow (with dispatch) ... and it's not designed to be executed as mixed job

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how I do it: https://github.com/hynek/structlog/blob/main/.github/workflows/pypi-package.yml

If you want, you can copy it verbatim and just change the trigger conditions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it make sense to have the release code in a separate workflow.

At the same time, I hope we can keep towncrier automation simple and have everything in a single file to make it easier to discover and see what is going on in GitHub Actions.


I don't know what's best here :|

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think (as demonstrated :)) that CI and publishing are sufficiently distinct issues, that it absolutely makes sense to keep them apart. But that's not something we need / should solve here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to experiment with that and make another PR.

# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

needs:
- build
Expand All @@ -211,7 +215,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Install dependencies
run: |
Expand All @@ -222,15 +226,11 @@ jobs:
run: ls --recursive dist/

- name: Check matched tag version and branch version - on tag
if: startsWith(github.ref, 'refs/tags/')
run: python admin/check_tag_version_match.py "${{ github.ref }}"

- name: Publish to PyPI - on tag
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@37f50c210e3d2f9450da2cd423303d6a14a6e29f
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598


coverage:
name: Combine & check coverage.
Expand Down Expand Up @@ -281,12 +281,12 @@ jobs:
needs:
# This is the list of CI job that we are interested to be green before
# a merge.
# pypi-publish is skipped since this is only executed for a tag.
- build
- test-linux
- test-windows
- coverage
- check
- pypi-publish
steps:
- name: Require all successes
uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
Expand Down
55 changes: 53 additions & 2 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,58 @@
Release notes
#############

``towncrier`` issues are filed on `GitHub <https://github.com/twisted/towncrier/issues>`_, and each ticket number here corresponds to a closed GitHub issue.

.. towncrier release notes start

towncrier 23.6.0 (2023-06-06)
=============================

This is the last release to support Python 3.7.


Features
--------

- Make ``towncrier create`` use the fragment counter rather than failing
on existing fragment names.

For example, if there is an existing fragment named ``123.feature``,
then ``towncrier create 123.feature`` will now create a fragment
named ``123.feature.1``. (`#475 <https://github.com/twisted/towncrier/issues/475>`_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub release tags don't seem to be able to render RST links such as this.

Is that a problem?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pandoc'ed it now.

- Provide a default Markdown template if the configured filename ends with ``.md``.

The Markdown template uses the same rendered format as the default *reStructuredText* template, but with a Markdown syntax. (`#483 <https://github.com/twisted/towncrier/issues/483>`_)
- Towncrier no longer depends on setuptools & uses importlib.resources (or its backport) instead. (`#496 <https://github.com/twisted/towncrier/issues/496>`_)
- Added pre-commit hooks for checking and updating news in projects using pre-commit. (`#498 <https://github.com/twisted/towncrier/issues/498>`_)
- Calling ``towncrier check`` without an existing configuration, will just show only an error message.

In previous versions, a traceback was generated instead of the error message. (`#501 <https://github.com/twisted/towncrier/issues/501>`_)


Bugfixes
--------

- Fix creating fragment in a section not adding random characters.

For example, ``towncrier create some_section/+.feature`` should end up as a fragment named something like ``news/some_section/+a4e22da1.feature``. (`#468 <https://github.com/twisted/towncrier/issues/468>`_)
- Fix the ReadTheDocs build for ``towncrier`` which was broken due to the python version in use being 3.8. Upgrade to 3.11. (`#509 <https://github.com/twisted/towncrier/issues/509>`_)


Improved Documentation
----------------------

- Moved man page to correct section (`#470 <https://github.com/twisted/towncrier/issues/470>`_)
- Update link to Quick Start in configuration.html to point to Tutorial instead. (`#504 <https://github.com/twisted/towncrier/issues/504>`_)
- Add a note about the build command's ``--version`` requiring the command to be explicitly passed. (`#511 <https://github.com/twisted/towncrier/issues/511>`_)
- Fix typos in the Pre-Commit docs. (`#512 <https://github.com/twisted/towncrier/issues/512>`_)


Misc
----

- `#459 <https://github.com/twisted/towncrier/issues/459>`_, `#462 <https://github.com/twisted/towncrier/issues/462>`_, `#472 <https://github.com/twisted/towncrier/issues/472>`_, `#485 <https://github.com/twisted/towncrier/issues/485>`_, `#486 <https://github.com/twisted/towncrier/issues/486>`_, `#487 <https://github.com/twisted/towncrier/issues/487>`_, `#488 <https://github.com/twisted/towncrier/issues/488>`_, `#495 <https://github.com/twisted/towncrier/issues/495>`_, `#497 <https://github.com/twisted/towncrier/issues/497>`_, `#507 <https://github.com/twisted/towncrier/issues/507>`_, `#1117 <https://github.com/twisted/towncrier/issues/1117>`_, `#513 <https://github.com/twisted/towncrier/issues/513>`_


towncrier 22.12.0 (2022-12-21)
==============================
Expand Down Expand Up @@ -324,7 +375,7 @@ Misc


towncrier 17.1.0
==========
================

Bugfixes
--------
Expand All @@ -333,7 +384,7 @@ Bugfixes


towncrier 16.12.0
==========
=================

Bugfixes
--------
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Development
.. toctree::
:maxdepth: 1

release-notes
contributing
release
GitHub Repository <https://github.com/twisted/towncrier>
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../NEWS.rst
2 changes: 1 addition & 1 deletion src/towncrier/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from incremental import Version


__version__ = Version("towncrier", 22, 12, 1, dev=0)
__version__ = Version("towncrier", 23, 6, 1, dev=0)
# The version is exposed in string format to be
# available for the hatching build tools.
_hatchling_version = __version__.short()
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/+docs-compare-with.misc

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions src/towncrier/newsfragments/459.misc

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions src/towncrier/newsfragments/468.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/470.doc

This file was deleted.

Empty file.
6 changes: 0 additions & 6 deletions src/towncrier/newsfragments/475.feature

This file was deleted.

3 changes: 0 additions & 3 deletions src/towncrier/newsfragments/483.feature

This file was deleted.

Empty file.
Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/487.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/488.misc

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/496.feature

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/498.feature

This file was deleted.

3 changes: 0 additions & 3 deletions src/towncrier/newsfragments/501.feature

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/504.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/507.misc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/509.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/511.doc

This file was deleted.

1 change: 0 additions & 1 deletion src/towncrier/newsfragments/512.doc

This file was deleted.

Empty file.