Commit 34cd166
Add GitHub Actions release workflow with Trusted Publisher (facebookresearch#121)
Summary:
Pull Request resolved: facebookresearch#121
## Problem
PrivacyGuard has no automated PyPI publishing workflow. Publishing requires manual package builds and API token management.
## Solution
Add a GitHub Actions release workflow using PyPI Trusted Publishers (OIDC-based authentication, no API tokens needed).
### New: `.github/workflows/release.yml`
- Triggers on GitHub Release publish or manual `workflow_dispatch`
- Runs the full test suite before building (reuses `reusable_test.yml`)
- Builds sdist + wheel via `python -m build`
- Publishes to PyPI using `pypa/gh-action-pypi-publish` with OIDC Trusted Publisher auth
- Requires a `pypi` GitHub environment (for optional approval gating)
### Modified: `pyproject.toml`
- Enabled `setuptools_scm` (was commented out) so package version is derived from git tags automatically
- Removed the unused `write_to` option — version is resolved at build time without generating a `version.py`
## Setup required before first use
1. **PyPI**: Register a pending Trusted Publisher at pypi.org -> Account -> Publishing:
- PyPI project name: `PrivacyGuard`
- Owner: `facebookresearch`
- Repository: `PrivacyGuard`
- Workflow: `release.yml`
- Environment: `pypi`
2. **GitHub**: Create a `pypi` environment in repo Settings -> Environments (optionally add required reviewers)
3. **To publish**: Create a GitHub Release with a version tag (e.g., `v0.1.0`) — the workflow runs automatically
Reviewed By: iden-kalemaj
Differential Revision: D98518834
fbshipit-source-id: 1d0c37ab97d4b42007fc7db4a13901e92c31ac011 parent 6e90c21 commit 34cd166
2 files changed
Lines changed: 57 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
0 commit comments