Skip to content

Migrate PyPI publishing to Trusted Publishing (OIDC) - #122

Merged
ajinabraham merged 2 commits into
mainfrom
chore/pypi-trusted-publishing
Aug 10, 2026
Merged

Migrate PyPI publishing to Trusted Publishing (OIDC)#122
ajinabraham merged 2 commits into
mainfrom
chore/pypi-trusted-publishing

Conversation

@ajinabraham

Copy link
Copy Markdown
Member

Summary

  • Switch .github/workflows/publish.yml from twine + PYPI_USERNAME/PYPI_PASSWORD to PyPI Trusted Publishing via pypa/gh-action-pypi-publish
  • Require id-token: write and a GitHub Environment named pypi
  • Build with python -m build instead of python setup.py sdist bdist_wheel
  • Trigger on release: published (skips draft releases)

Manual setup (required before first release)

  1. On PyPI: mobsfscan → Publishing → add Trusted Publisher:
    • Owner: MobSF
    • Repository: mobsfscan
    • Workflow: publish.yml
    • Environment: pypi
  2. On GitHub: Settings → Environments → create pypi (optional protection rules)
  3. After the first successful OIDC publish, delete repo secrets PYPI_USERNAME and PYPI_PASSWORD

Test plan

  • Confirm PyPI trusted publisher matches this workflow filename/environment
  • Confirm GitHub Environment pypi exists
  • Publish a GitHub Release (or dry-run on TestPyPI if preferred) and verify upload succeeds without API token secrets

Made with Cursor

Replace twine username/password secrets with pypa/gh-action-pypi-publish
and id-token permissions. Build with python -m build; publish on
release published events via a GitHub Environment named pypi.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajinabraham
ajinabraham merged commit 2659f2a into main Aug 10, 2026
11 checks passed
@ajinabraham
ajinabraham deleted the chore/pypi-trusted-publishing branch August 10, 2026 06:05
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.

1 participant