Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

ci: publish Python packages to PyPI via trusted publishing (#1828)

devin-ai-integration[bot]2a0b1d1bec15
diff --git a/.github/workflows/publish_candidates.yml b/.github/workflows/publish_candidates.yml
index 53b847f08..b35f10cd5 100644
--- a/.github/workflows/publish_candidates.yml
+++ b/.github/workflows/publish_candidates.yml
@@ -81,9 +81,7 @@ jobs:
BASE_VERSION=$(uv version --short)
uv version "${BASE_VERSION}rc${{ github.run_id }}"
uv build
- uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/
- env:
- PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
+ uv publish --trusted-publishing always --check-url https://pypi.org/simple/
- name: Install JS dependencies
if: ${{ inputs.js-sdk || inputs.cli }}
diff --git a/.github/workflows/publish_packages.yml b/.github/workflows/publish_packages.yml
index 0df09e4f8..cc6512f98 100644
--- a/.github/workflows/publish_packages.yml
+++ b/.github/workflows/publish_packages.yml
@@ -5,8 +5,6 @@ on:
secrets:
E2B_API_KEY:
required: true
- PYPI_TOKEN:
- required: true
VERSION_BUMPER_SECRET:
required: true
@@ -106,8 +104,6 @@ jobs:
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: '' # See https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
- PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Push new versions
# A failed publish may have uploaded some Python packages before tagging.
diff --git a/packages/code-interpreter-python/package.json b/packages/code-interpreter-python/package.json
index 4d58b6fd9..53accbd58 100644
--- a/packages/code-interpreter-python/package.json
+++ b/packages/code-interpreter-python/package.json
@@ -5,7 +5,7 @@
"scripts": {
"test": "uv run pytest -n 4 --verbose -x",
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
- "postPublish": "uv build && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
+ "postPublish": "uv build && uv publish --trusted-publishing always --check-url https://pypi.org/simple/",
"typecheck": "uv run make typecheck",
"lint": "uv run make lint",
"format": "uv run make format"
diff --git a/packages/desktop-python/package.json b/packages/desktop-python/package.json
index 199ed3c3f..8a97fbedd 100644
--- a/packages/desktop-python/package.json
+++ b/packages/desktop-python/package.json
@@ -5,7 +5,7 @@
"scripts": {
"test": "uv run pytest -n 4 --verbose -x",
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
- "postPublish": "uv build && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
+ "postPublish": "uv build && uv publish --trusted-publishing always --check-url https://pypi.org/simple/",
"typecheck": "uv run make typecheck",
"lint": "uv run make lint",
"format": "uv run make format"
diff --git a/packages/python-sdk/package.json b/packages/python-sdk/package.json
index 2199e5dbe..ec34c6d51 100644
--- a/packages/python-sdk/package.json
+++ b/packages/python-sdk/package.json
@@ -5,7 +5,7 @@
"scripts": {
"test": "uv run pytest -n 4 --verbose -x",
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
- "postPublish": "uv build && uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/",
+ "postPublish": "uv build && uv publish --trusted-publishing always --check-url https://pypi.org/simple/",
"typecheck": "uv run make typecheck",
"lint": "uv run make lint",
"format": "uv run make format"