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

#571 Use pre-commit dog food and update release process for pre-commit autoupdate. #572

Merged
merged 16 commits into from
May 21, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -292,6 +322,7 @@ jobs:
- test-windows
- coverage
- check
- pre-commit
steps:
- name: Require all successes
uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/twisted/towncrier/pull/590>`_ for more details.

You can announce the release over IRC or Gitter.

Expand Down
4 changes: 2 additions & 2 deletions docs/pre-commit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/
Expand Down
Empty file.
Loading