diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08871404..850af7aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,36 @@ jobs: if: ${{ matrix.task.run-if }} + pre-commit: + name: Check pre-commit integration + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install dependencies + run: python -m pip install pre-commit + + - name: Install pre-commit + run: | + pre-commit install + + - name: Update pre-commit + run: | + pre-commit autoupdate + + - name: Run pre-commit + run: | + pre-commit run -a + + pypi-publish: name: Check tag and publish # Only trigger this for tag changes. @@ -292,6 +322,7 @@ jobs: - test-windows - coverage - check + - pre-commit steps: - name: Require all successes uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5e6a6b43..a96ca41a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,3 +33,8 @@ repos: - id: debug-statements - id: check-toml - id: check-yaml + + - repo: https://github.com/twisted/towncrier + rev: 23.11.0 + hooks: + - id: towncrier-check diff --git a/RELEASE.rst b/RELEASE.rst index eaeca382..8b457aa7 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -102,7 +102,14 @@ In ``src/towncrier/_version.py`` the version is set using ``incremental`` such a Commit and push the changes. -Merge the commit in the main branch. +Merge the commit in the main branch, **without using squash**. + +We tag the release based on a commit from the release branch. +If we merge with squash, +the release tag commit will no longer be found in the main branch history. +With a squash merge, the whole branch history is lost. +This causes the `pre-commit autoupdate` to fail. +See `PR590 `_ for more details. You can announce the release over IRC or Gitter. diff --git a/docs/pre-commit.rst b/docs/pre-commit.rst index 452bd155..ebf04b54 100644 --- a/docs/pre-commit.rst +++ b/docs/pre-commit.rst @@ -16,7 +16,7 @@ Usage with the default configuration repos: - repo: https://github.com/twisted/towncrier - rev: 22.13.0 # run 'pre-commit autoupdate' to update + rev: 23.11.0 # run 'pre-commit autoupdate' to update hooks: - id: towncrier-check @@ -30,7 +30,7 @@ News fragments are stored in ``changelog.d/`` in the root of the repository and repos: - repo: https://github.com/twisted/towncrier - rev: 22.13.0 # run 'pre-commit autoupdate' to update + rev: 23.11.0 # run 'pre-commit autoupdate' to update hooks: - id: towncrier-update files: $changelog\.d/ diff --git a/src/towncrier/newsfragments/571.misc b/src/towncrier/newsfragments/571.misc new file mode 100644 index 00000000..e69de29b