Skip to content

cd: add PyPI release workflow with trusted publishing#20

Merged
kavya-chennoju merged 2 commits intomainfrom
release-workflow
Apr 23, 2026
Merged

cd: add PyPI release workflow with trusted publishing#20
kavya-chennoju merged 2 commits intomainfrom
release-workflow

Conversation

@kavya-chennoju
Copy link
Copy Markdown
Collaborator

@kavya-chennoju kavya-chennoju commented Apr 22, 2026

Summary

Adds .github/workflows/release.yml so a vX.Y.Z tag push publishes all three packages (device-connect-edge, device-connect-server, device-connect-agent-tools) to PyPI.

  • Trigger: tag push matching v* (or workflow_dispatch with a ref).
  • Trusted Publishing (OIDC): no stored tokens. PyPI projects are already configured with arm/device-connect + release.yml + pypi environment as the trusted publisher.
  • pypi environment: deployments require reviewer approval (configured in repo Settings → Environments).
  • Version guard: the job fails fast if the tag version doesn't match each package's pyproject.toml version, preventing mismatched releases.
  • Matrix: builds and publishes the three packages in parallel; artifacts uploaded per package for traceability.

Release procedure (after this merges)

  1. Bump version in each packages/*/pyproject.toml in lockstep.
  2. Merge to main.
  3. git tag -a vX.Y.Z -m "Release X.Y.Z" && git push origin vX.Y.Z.
  4. Approve the pypi environment deployment in the Actions UI.

Context

Currently main is at 0.2.2 (published via a one-off twine upload today). PyPI and main drift was the motivation — going forward, PyPI only updates from tagged commits that pass the version guard.

Test plan

  • CI workflow (ci.yml) still runs on this PR and passes.

Publishes device-connect-edge, -server, -agent-tools to PyPI when a
vX.Y.Z tag is pushed. Uses OIDC trusted publishing via the 'pypi'
environment (no stored tokens). A version guard fails the build if
the tag doesn't match the package's pyproject.toml version.
@kavya-chennoju kavya-chennoju changed the title ci: add PyPI release workflow with trusted publishing cd: add PyPI release workflow with trusted publishing Apr 22, 2026
atsyplikhin added a commit that referenced this pull request Apr 22, 2026
- Resolve release version from inputs.ref || github.ref_name and require
  v* shape, so workflow_dispatch cannot bypass the guard.
- Parse pyproject.toml with tomllib instead of grep|sed (robust to
  quoting style and dynamic version keys).
- fail-fast=true on publish matrix: build already proved all three
  artifacts valid, and PyPI rejects re-uploads of the same version,
  so a half-succeeded publish can't be cleanly retried.

Addresses review comments #1-#3 on PR #20.

Co-Authored-By: Kavya Chennoju <kavya.chennoju@arm.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Resolve release version from inputs.ref || github.ref_name and require
  v* shape, so workflow_dispatch cannot bypass the guard.
- Parse pyproject.toml with tomllib instead of grep|sed (robust to
  quoting style and dynamic version keys).
- fail-fast=true on publish matrix: build already proved all three
  artifacts valid, and PyPI rejects re-uploads of the same version,
  so a half-succeeded publish can't be cleanly retried.

Addresses review comments #1-#3 on PR #20.

Co-Authored-By: Kavya Chennoju <kavya.chennoju@arm.com>
@kavya-chennoju kavya-chennoju merged commit f6c9666 into main Apr 23, 2026
9 checks passed
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.

2 participants