diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 623febe..c38c280 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,41 +1,13 @@ name: Release on: - workflow_dispatch: + push: + tags: + - "v*" jobs: - release: - name: Semantic Release - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - - outputs: - released: ${{ steps.release.outputs.released }} - tag: ${{ steps.release.outputs.tag }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.RELEASE_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.13" - - - name: Python Semantic Release - id: release - uses: python-semantic-release/python-semantic-release@v9 - with: - github_token: ${{ secrets.RELEASE_TOKEN }} - publish: name: Publish to PyPI - needs: release - if: needs.release.outputs.released == 'true' runs-on: ubuntu-latest environment: pypi permissions: @@ -43,15 +15,21 @@ jobs: steps: - uses: actions/checkout@v4 - with: - ref: ${{ needs.release.outputs.tag }} - fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.13" + - name: Verify tag matches pyproject.toml version + run: | + TAG_VERSION="${GITHUB_REF_NAME#v}" + PROJECT_VERSION="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')" + if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then + echo "Tag $GITHUB_REF_NAME does not match pyproject.toml version $PROJECT_VERSION" >&2 + exit 1 + fi + - name: Build package run: | pip install build diff --git a/CHANGELOG.md b/CHANGELOG.md index f40a193..39817bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ -# CHANGELOG +# 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). + +Entries below `v1.2.0` were generated by semantic-release; the project has +since switched to hand-written releases. + +## [Unreleased] ## v1.2.0 (2026-08-15) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e248b49..5006480 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,6 +70,18 @@ DJANGO_SETTINGS_MODULE=settings_dev django-admin runserver --- +## Release process (maintainers) + +Releases are fully manual — merging to `master` never triggers a release. + +1. Bump the version in `pyproject.toml` (`project.version`) and `django_sysconfig/__init__.py` (`__version__`) +2. Move the `## [Unreleased]` entries in `CHANGELOG.md` under a new `## [X.Y.Z] - YYYY-MM-DD` heading, grouped into `Added`/`Changed`/`Deprecated`/`Removed`/`Fixed`/`Security` per [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) +3. Commit: `chore(release): X.Y.Z` +4. Tag: `git tag vX.Y.Z` and `git push origin vX.Y.Z` +5. The tag push triggers the `Release` workflow, which builds and publishes to PyPI + +--- + ## Reporting bugs Open an issue on [GitHub Issues](https://github.com/krishnamodepalli/django-sysconfig/issues) with: diff --git a/pyproject.toml b/pyproject.toml index 94c87e4..4e70c26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,24 +86,3 @@ target-version = "py310" [tool.ruff.lint] select = ["E", "W", "F", "I", "B", "C4", "UP"] ignore = ["E501", "B008", "C901"] - -[tool.semantic_release] -version_toml = ["pyproject.toml:project.version"] -version_variables = [ - "django_sysconfig/__init__.py:__version__" -] -branch = "master" -commit_message = "chore(release): {version}" -tag_format = "v{version}" - -[tool.semantic_release.changelog] -file = "CHANGELOG.md" - -[tool.semantic_release.commit_parser_options] -allowed_tags = ["feat", "fix", "perf", "docs", "refactor", "test", "build", "ci", "chore", "revert"] -minor_tags = ["feat"] -patch_tags = ["fix", "refactor", "perf"] -default_bump_level = 0 - -[tool.semantic_release.publish] -upload_to_vcs_release = true