Skip to content

Document automated PyPI publishing and validate release tags - #116

Merged
gregnazario merged 5 commits into
mainfrom
cursor/pypi-publish-docs-12c5
Jun 18, 2026
Merged

Document automated PyPI publishing and validate release tags#116
gregnazario merged 5 commits into
mainfrom
cursor/pypi-publish-docs-12c5

Conversation

@gregnazario

@gregnazario gregnazario commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses #28 / aptos-core#7410.

Automated PyPI deployment is already implemented on main via .github/workflows/publish.yaml (added in a468fa4). On a published GitHub Release, CI:

  1. Runs unit + BDD tests
  2. Builds with uv build
  3. Publishes to PyPI via OIDC trusted publishing (pypa/gh-action-pypi-publish, pypi environment)

This PR closes the remaining gaps:

  • CONTRIBUTING.md — documents the one-time PyPI trusted-publisher setup, the correct release flow (GitHub Release, not tag-only push), and the workflow-dispatch dry-run option.
  • publish.yaml — fails early if the release tag does not match pyproject.toml version (e.g. tag v0.12.0 requires version 0.12.0), including for manual workflow_dispatch publishes.

Maintainer action still required

Before the first automated publish from this repo, a maintainer must:

  1. Add a trusted publisher on PyPI for aptos-sdk pointing at aptos-labs/aptos-python-sdk, workflow publish.yaml, environment pypi.
  2. Create the pypi GitHub environment (no secrets needed).

After that, publishing is: bump version → merge → create GitHub Release → done.

Test Plan

  • Verified uv build succeeds locally.
  • Workflow change is a guarded shell check on publish paths; dry-run workflow_dispatch is unaffected.

Related Links

Open in Web Open in Cursor 

The publish pipeline (tests, build, OIDC upload on GitHub Release) was
already on main. This fills the remaining gaps:

- Expand CONTRIBUTING.md with trusted-publisher setup, release steps, and
  dry-run instructions (replacing the outdated tag-only push docs).
- Fail the build job early when a release tag does not match pyproject.toml.

Co-authored-by: Greg Nazario <greg@gnazar.io>
@gregnazario
gregnazario requested a review from a team as a code owner June 17, 2026 13:50
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.97%. Comparing base (9fb9b55) to head (4fbaac0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
- Coverage   93.20%   92.97%   -0.24%     
==========================================
  Files          56       56              
  Lines        5183     4952     -231     
==========================================
- Hits         4831     4604     -227     
+ Misses        352      348       -4     
Flag Coverage Δ *Carryforward flag
v1-sdk 90.36% <ø> (ø)
v2-sdk 96.87% <ø> (-0.15%) ⬇️ Carriedforward from 84f4fe0

*This pull request uses carry forward flags. Click here to find out more.
see 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the intended automated PyPI release process for the Aptos Python SDK and adds a CI guard to ensure GitHub Release tags align with the package version in pyproject.toml, reducing the risk of publishing a mismatched version.

Changes:

  • Expanded CONTRIBUTING.md with one-time trusted publisher setup steps and an explicit GitHub Release-based publishing flow.
  • Added an early workflow check to fail the publish pipeline if the release tag doesn’t match the package version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
CONTRIBUTING.md Documents the automated PyPI publishing setup and the recommended release workflow.
.github/workflows/publish.yaml Adds a tag/version consistency check before building artifacts for release publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yaml
- Run version check for workflow_dispatch publishes (not just releases).
- Require manual publishes to be dispatched from a matching v* tag.
- Read pyproject.toml with stdlib python/pathlib instead of uv run.

Co-authored-by: Greg Nazario <greg@gnazar.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/publish.yaml Outdated
Co-authored-by: Greg Nazario <greg@gnazar.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/publish.yaml Outdated
cursoragent and others added 2 commits June 18, 2026 17:19
Boolean inputs are passed as strings in GitHub Actions expressions.
Compare explicitly against false/'false' instead of !inputs.dry_run so
version validation and publish gating work when Dry run is disabled.

Co-authored-by: Greg Nazario <greg@gnazar.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread CONTRIBUTING.md
@gregnazario
gregnazario merged commit 99fe87b into main Jun 18, 2026
11 checks passed
@gregnazario
gregnazario deleted the cursor/pypi-publish-docs-12c5 branch June 18, 2026 18:36
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.

3 participants