ci(release): publish to PyPI with the PYPI_API_TOKEN secret instead of OIDC trusted publishing
Release / test (push) Canceled after 0s
Release / build (push) Canceled after 0s
Release / publish-pypi (push) Canceled after 0s
Release / github-release (push) Canceled after 0s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Umutcan Edizsalan
2026-07-23 15:37:17 +03:00
co-authored by Cursor
parent d15068efc5
commit 67f2c3b575
+10 -10
View File
@@ -1,12 +1,13 @@
name: Release
# Tag-driven release: run the test gate, build, publish to PyPI via trusted
# publishing (OIDC — no API token stored in the repo), then cut the GitHub
# Release with the built artifacts attached.
# Tag-driven release: run the test gate, build, publish to PyPI, then cut the
# GitHub Release with the built artifacts attached.
#
# One-time setup on PyPI (manual): project "autocad-mcp-pro" -> Publishing ->
# add GitHub publisher repo=U-C4N/Autocad-MCP workflow=release.yml
# environment=pypi.
# Auth: the PYPI_API_TOKEN repository secret (an API token from
# https://pypi.org/manage/account/token/). Once the project exists on PyPI,
# prefer replacing it with a project-scoped token — or switch back to trusted
# publishing (OIDC) by restoring `environment: pypi` + `id-token: write` and
# registering the publisher on PyPI.
on:
push:
@@ -57,16 +58,15 @@ jobs:
publish-pypi:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI (trusted publishing)
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
github-release:
needs: publish-pypi