Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(release): unblock 4.0.x publishing (mcp CVE floor, one PyPI job per project) (#779)

Ruben Lütke7ea8d868e772
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2c220f82b9..2fa65a938c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,9 +19,14 @@
# package files, which is why install/installer.py removes `personal-jarvis`
# before it installs `dodaios`.
#
-# The build and the publish are two jobs on purpose. Only the tiny publish job
-# holds `id-token: write` and enters the `pypi` environment, so the OIDC token
-# is never reachable from the step that executes project code.
+# The build and the publish are separate jobs on purpose. Only the tiny publish
+# jobs hold `id-token: write` and enter a publishing environment, so the OIDC
+# token is never reachable from the step that executes project code.
+#
+# Each project publishes from its OWN job and environment: PyPI scopes the token
+# it mints to the one trusted publisher that matched, so one job cannot upload to
+# two projects. `dodaios` trusts environment `pypi`, `personal-jarvis` trusts
+# environment `pypi-legacy` (both: Dodaios/Dodaios, release.yml).
#
# Action SHAs are pinned to 40-char commits (CVE-2025-30066 hardening), matching
# the rest of this repo's workflows.
@@ -152,17 +157,35 @@ jobs:
name: dist
path: dist/
- # The established project first: existing installs update from it. A
- # re-run after a partial upload skips the files PyPI already holds
+ # A re-run after a partial upload skips the files PyPI already holds
# (released files are immutable, so they are the ones this tag built).
- - name: Publish personal-jarvis (earlier name)
+ - name: Publish dodaios
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
- packages-dir: dist/personal-jarvis/
+ packages-dir: dist/dodaios/
skip-existing: true
- - name: Publish dodaios
+ publish-legacy:
+ name: Publish to PyPI (personal-jarvis, earlier name)
+ needs: [admit, prepare, build]
+ if: github.ref_type == 'tag' && needs.admit.result == 'success' && needs.prepare.result == 'success'
+ runs-on: ubuntu-latest
+ environment: pypi-legacy
+ timeout-minutes: 10
+ permissions:
+ # The ONLY thing this job is trusted with: minting the OIDC token that
+ # PyPI exchanges for a short-lived upload credential.
+ id-token: write
+ steps:
+ - name: Download the artifacts
+ uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
+ with:
+ name: dist
+ path: dist/
+
+ # Existing `pip install personal-jarvis` installs keep updating from it.
+ - name: Publish personal-jarvis
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
- packages-dir: dist/dodaios/
+ packages-dir: dist/personal-jarvis/
skip-existing: true
diff --git a/tests/unit/ci/test_build_distributions.py b/tests/unit/ci/test_build_distributions.py
index 20de934a94..41df09bb66 100644
--- a/tests/unit/ci/test_build_distributions.py
+++ b/tests/unit/ci/test_build_distributions.py
@@ -138,12 +138,22 @@ def test_the_release_builds_both_names_and_publishes_each() -> None:
build_runs = "\n".join(step.get("run", "") for step in jobs["build"]["steps"])
assert "scripts/ci/build_distributions.py --outdir dist" in build_runs
assert "python -m build " not in build_runs
- publishes = [
- step
- for step in jobs["publish"]["steps"]
- if "gh-action-pypi-publish@" in step.get("uses", "")
- ]
- assert [step["with"]["packages-dir"] for step in publishes] == [
- "dist/personal-jarvis/",
- "dist/dodaios/",
- ]
+ # PyPI scopes an upload token to the one trusted publisher that matched,
+ # so each project publishes from its own job and environment.
+ uploads = {
+ job_id: (
+ jobs[job_id]["environment"],
+ [
+ step["with"]["packages-dir"]
+ for step in jobs[job_id]["steps"]
+ if "gh-action-pypi-publish@" in step.get("uses", "")
+ ],
+ )
+ for job_id in ("publish", "publish-legacy")
+ }
+ assert uploads == {
+ "publish": ("pypi", ["dist/dodaios/"]),
+ "publish-legacy": ("pypi-legacy", ["dist/personal-jarvis/"]),
+ }
+ for job_id in uploads:
+ assert jobs[job_id]["permissions"] == {"id-token": "write"}