Skip to content
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
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish to PyPI

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for trusted publishing (recommended)

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: python -m build

- name: Check package
run: twine check dist/*

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ include CONTRIBUTING.md
include CHANGELOG.md
include pyproject.toml
recursive-include django_rewind *.py
recursive-exclude django_rewind/tests *
recursive-include django_rewind/migrations *.py
recursive-include django_rewind/templates *
global-exclude __pycache__
global-exclude *.py[co]
global-exclude .git*
global-exclude test_project
global-exclude *.egg-info
global-exclude dist
global-exclude build
24 changes: 19 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,25 @@ packages = ["django_rewind"]

[tool.hatch.build.targets.sdist]
include = [
"/django_rewind",
"/README.md",
"/LICENSE",
"/CONTRIBUTING.md",
"/CHANGELOG.md",
"django_rewind",
"README.md",
"LICENSE",
"CONTRIBUTING.md",
"CHANGELOG.md",
]
exclude = [
"django_rewind/tests",
"test_project",
"*.pyc",
"__pycache__",
".git",
".github",
".pytest_cache",
".mypy_cache",
".tox",
"dist",
"build",
"*.egg-info",
]

[tool.black]
Expand Down