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
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ name: Release
on:
workflow_dispatch:

# The reusable release workflow needs write (bump/merge/tag/release) + OIDC. A reusable workflow
# can't exceed the caller's grant, so grant it here, otherwise the run fails at startup.
permissions:
contents: write
id-token: write

jobs:
release:
uses: ParkerIndustries/workflows/.github/workflows/release.yml@v1
Expand All @@ -28,3 +34,23 @@ jobs:
# If this project publishes docs, set docs-url to add "New/Updated Documentation"
# sections (linking changed docs/**.md pages) to the release changelog:
# docs-url: https://your-project.example.com

# PyPI publish runs HERE, in the caller — Trusted Publishing can't match a reusable workflow.
publish-pypi:
name: Publish to PyPI
needs: release
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/project-template
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v8
with:
pattern: dist-*
merge-multiple: true
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then:

**1. Rename the placeholders** (two tokens — find & replace across the repo)
- `project-template` → your PyPI/distribution name (hyphens): in `pyproject.toml`
(`[project].name`), `.github/workflows/release.yml` (`pypi-package-name`), and `mkdocs.yml`.
(`[project].name`), `.github/workflows/release.yml` (`pypi-package-name` and the publish job's PyPI `url`), and `mkdocs.yml`.
- `project_template` → your import/package name (underscores): the `project_template/`
directory, plus its `--cov=` / `packages` / `pythonpath` references in `pyproject.toml`.
- If not publishing docs, delete `mkdocs.yml`, `docs/`, and `.github/workflows/docs.yml`;
Expand Down
Loading