Skip to content

Migrate to GitHub Actions automated release process#13

Closed
jensens wants to merge 1 commit intorefactor-package-layoutfrom
migrate-github-actions
Closed

Migrate to GitHub Actions automated release process#13
jensens wants to merge 1 commit intorefactor-package-layoutfrom
migrate-github-actions

Conversation

@jensens
Copy link
Member

@jensens jensens commented Nov 7, 2025

Overview

This PR modernizes the CI/CD pipeline to match the mxrepo workflow and implements automated releases via GitHub Actions.

Changes

New Workflow Files

  • lint.yml: Automated code quality checks (ruff, isort)
  • typecheck.yml: Type checking with mypy on Python 3.13
  • release.yml: Automated PyPI publishing workflow
    • Publishes to Test PyPI on every master push
    • Publishes to production PyPI on GitHub releases
    • Uses build attestation for supply chain security
  • dependabot.yml: Weekly GitHub Actions dependency updates

Updated Workflow Files

test.yml:

  • Switch from actions/setup-python to astral-sh/setup-uv@v7 for faster dependency management
  • Update Python versions from 3.7-3.12 to 3.10-3.14
  • Add workflow_call and workflow_dispatch triggers for reusability
  • Implement coverage artifact collection and reporting (addresses Add Github Actions for testing and docs building #3)
  • Add dedicated coverage job with HTML report generation
  • Update to latest action versions (checkout@v5)

docs.yml:

  • Switch to astral-sh/setup-uv@v7 for consistency
  • Update action versions (checkout@v5, setup-node@v4)
  • Update Node.js version from 16 to 20
  • Add workflow_call trigger for reusability

Build System Migration

pyproject.toml (new):

  • Migrate from setup.cfg to modern pyproject.toml format
  • Use hatch-vcs for automatic versioning from git tags
  • Use hatch-fancy-pypi-readme for combined readme
  • Configure ruff, isort, mypy, pytest, and coverage
  • Maintain backward compatibility with zest.releaser config

Documentation

RELEASE.md (new):

  • Comprehensive release process documentation
  • Automated GitHub release workflow instructions
  • PyPI Trusted Publishing setup guide
  • Version numbering guidelines
  • Troubleshooting section
  • Migration notes from zest.releaser

Post-Merge Actions Required

After merging this PR, the following steps are needed:

  1. Configure GitHub Environments:

    • Create release-test-pypi environment
    • Create release-pypi environment
  2. Set up PyPI Trusted Publishing:

  3. Test the Workflow:

    • First push to master will trigger Test PyPI release
    • Create a GitHub release (e.g., v1.3.0) to publish to production PyPI

Related Issues

Testing

  • All workflows use the same patterns as the proven mxrepo implementation
  • Coverage artifacts follow best practices from https://hynek.me/articles/ditch-codecov-python/
  • Build configuration tested with hatch-vcs and hatch-fancy-pypi-readme

Migration Notes

  • The old manual release process using zest.releaser will be replaced by automated GitHub releases
  • Version numbers will now be automatically determined from git tags
  • setup.cfg is superseded by pyproject.toml but can coexist during transition

This commit modernizes the CI/CD pipeline to match the mxrepo workflow
and implements automated releases via GitHub Actions.

## New Workflow Files

- Add lint.yml: Automated code quality checks (ruff, isort)
- Add typecheck.yml: Type checking with mypy
- Add release.yml: Automated PyPI publishing workflow
  - Publishes to Test PyPI on every master push
  - Publishes to production PyPI on GitHub releases
- Add dependabot.yml: Weekly GitHub Actions dependency updates

## Updated Workflow Files

- Update test.yml:
  - Switch from actions/setup-python to astral-sh/setup-uv@v7
  - Update Python versions from 3.7-3.12 to 3.10-3.14
  - Add workflow_call and workflow_dispatch triggers
  - Implement coverage artifact collection and reporting
  - Add dedicated coverage job with HTML report generation
  - Update to latest action versions (checkout@v5)

- Update docs.yml:
  - Switch to astral-sh/setup-uv@v7 for consistency
  - Update action versions (checkout@v5, setup-node@v4)
  - Update Node.js version from 16 to 20
  - Add workflow_call trigger for reusability

## Build System Migration

- Add pyproject.toml:
  - Migrate from setup.cfg to modern pyproject.toml format
  - Use hatch-vcs for automatic versioning from git tags
  - Use hatch-fancy-pypi-readme for combined readme
  - Configure ruff, isort, mypy, pytest, and coverage
  - Maintain backward compatibility with zest.releaser config

## Documentation

- Add RELEASE.md: Comprehensive release process documentation
  - Automated GitHub release workflow
  - PyPI Trusted Publishing setup instructions
  - Version numbering guidelines
  - Troubleshooting guide
  - Migration notes from zest.releaser

## Related

- Addresses #3: GitHub Actions for testing with coverage artifacts
- Migrates release process from manual zest.releaser to automated GitHub releases
- Follows same pattern as https://github.com/mxstack/mxrepo
@jensens jensens changed the base branch from master to refactor-package-layout November 7, 2025 14:58
@jensens jensens closed this Nov 7, 2025
@jensens jensens deleted the migrate-github-actions branch November 7, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Github Actions for testing and docs building

1 participant