diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e12ad385..4e6f9d22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -126,19 +126,51 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} + prepare-release-notes: + name: Prepare Release Notes + needs: [lint] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Python + uses: actions/setup-python@v5 + - name: Install towncrier + run: pip install towncrier==24.8.0 + - name: Install pandoc + run: | + sudo apt-get install -y pandoc + - name: Install pytest-asyncio + run: pip install . + - name: Compile Release Notes Draft + if: ${{ !contains(github.ref, 'refs/tags/') }} + run: towncrier build --draft --version "${{ needs.lint.outputs.version }}" > release-notes.rst + - name: Extract release notes from Git tag + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + run: | + set -e + git for-each-ref github.ref --format='%(contents)' > release-notes.rst + # Strip PGP signature from signed tags + sed -i "/-----BEGIN PGP SIGNATURE-----/,/-----END PGP SIGNATURE-----\n/d" release-notes.rst + - name: Convert Release Notes to Markdown + run: | + pandoc -s -o release-notes.md release-notes.rst + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: release-notes.md + path: release-notes.md + deploy: name: Deploy environment: release # Run only on pushing a tag if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - needs: [lint, check] + needs: [lint, check, prepare-release-notes] runs-on: ubuntu-latest steps: - - name: Install pandoc - run: | - sudo apt-get install -y pandoc - - name: Checkout - uses: actions/checkout@v4 - name: Download distributions uses: actions/download-artifact@v4 with: @@ -147,20 +179,22 @@ jobs: - name: Collected dists run: | tree dist - - name: Convert README.rst to Markdown - run: | - pandoc -s -o README.md README.rst - name: PyPI upload uses: pypa/gh-action-pypi-publish@v1.12.4 with: attestations: true packages-dir: dist password: ${{ secrets.PYPI_API_TOKEN }} + - name: Download Release Notes + uses: actions/download-artifact@v4 + with: + name: release-notes.md + path: release-notes.md - name: GitHub Release uses: ncipollo/release-action@v1 with: name: pytest-asyncio ${{ needs.lint.outputs.version }} artifacts: dist/* - bodyFile: README.md + bodyFile: release-notes.md prerelease: ${{ needs.lint.outputs.prerelease }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/changelog.d/.gitkeep b/changelog.d/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/reference/changelog.rst b/docs/reference/changelog.rst index 11c35a1b..e64a8ad4 100644 --- a/docs/reference/changelog.rst +++ b/docs/reference/changelog.rst @@ -2,6 +2,14 @@ Changelog ========= +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +This project uses [*towncrier*](https://towncrier.readthedocs.io/) for changlog management and the changes for the upcoming release can be found in . + +.. towncrier release notes start + 0.26.0 (2025-03-25) =================== - Adds configuration option that sets default event loop scope for all tests `#793 `_ diff --git a/pyproject.toml b/pyproject.toml index b368b481..9cdd7b3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,3 +137,44 @@ parallel = true [tool.coverage.report] show_missing = true + +[tool.towncrier] +directory = "changelog.d" +filename = "docs/reference/changelog.rst" +title_format = "`{version} `_ - {project_date}" +issue_format = "`#{issue} `_" + +[[tool.towncrier.type]] +directory = "security" +name = "Security" +showcontent = true + +[[tool.towncrier.type]] +directory = "removed" +name = "Removed" +showcontent = true + +[[tool.towncrier.type]] +directory = "deprecated" +name = "Deprecated" +showcontent = true + +[[tool.towncrier.type]] +directory = "added" +name = "Added" +showcontent = true + +[[tool.towncrier.type]] +directory = "changed" +name = "Changed" +showcontent = true + +[[tool.towncrier.type]] +directory = "fixed" +name = "Fixed" +showcontent = true + +[[tool.towncrier.type]] +directory = "downstream" +name = "Notes for Downstream Packagers" +showcontent = true