Add GitHub Actions release workflow with Trusted Publisher#121
Closed
mgrange1998 wants to merge 2 commits into
Closed
Add GitHub Actions release workflow with Trusted Publisher#121mgrange1998 wants to merge 2 commits into
mgrange1998 wants to merge 2 commits into
Conversation
Summary: The pyproject.toml incorrectly declared the license as MIT, while the LICENSE file and README both specify Apache License 2.0. This fixes the metadata to match the actual license before first PyPI publish. Differential Revision: D98512204
Summary: ## 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 Differential Revision: D98518834
|
@mgrange1998 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98518834. |
iden-kalemaj
approved these changes
Mar 27, 2026
Contributor
iden-kalemaj
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request has been merged in 34cd166. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
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.ymlworkflow_dispatchreusable_test.yml)python -m buildpypa/gh-action-pypi-publishwith OIDC Trusted Publisher authpypiGitHub environment (for optional approval gating)Modified:
pyproject.tomlsetuptools_scm(was commented out) so package version is derived from git tags automaticallywrite_tooption — version is resolved at build time without generating aversion.pySetup required before first use
PrivacyGuardfacebookresearchPrivacyGuardrelease.ymlpypipypienvironment in repo Settings -> Environments (optionally add required reviewers)v0.1.0) — the workflow runs automaticallyDifferential Revision: D98518834