Skip to content

Add GitHub Actions workflow for PyPI publishing#18

Merged
CodeHalwell merged 1 commit intomasterfrom
claude/ci-cd-pypi-uv-YmzIN
Apr 29, 2026
Merged

Add GitHub Actions workflow for PyPI publishing#18
CodeHalwell merged 1 commit intomasterfrom
claude/ci-cd-pypi-uv-YmzIN

Conversation

@CodeHalwell
Copy link
Copy Markdown
Owner

Summary

This PR adds a GitHub Actions workflow to automate building and publishing the package to PyPI. The workflow is triggered on version tags (v*), GitHub releases, or manual dispatch. It builds source and wheel distributions, validates metadata with twine, and publishes to PyPI using trusted publishing (OIDC).

Checklist

  • Workflow configuration added (.github/workflows/publish.yml)
  • Unit tests covering the new behavior. (N/A - workflow configuration)
  • Round-trip test added to tests/integration/test_round_trip.py (N/A - workflow configuration)
  • HISTORY.rst entry under the unreleased section. (N/A - workflow configuration)
  • Doc updates if the change is user-visible. (N/A - internal CI/CD)
  • pytest --cov=pptx tests passes locally. (N/A - workflow configuration)
  • behave --stop passes locally. (N/A - workflow configuration)
  • No new pyright errors. (N/A - workflow configuration)

Test notes

The workflow will be tested automatically when:

  1. A version tag matching v* is pushed
  2. A GitHub release is published
  3. The workflow is manually triggered via workflow_dispatch

The workflow uses uv for dependency management and Python 3.12, builds distributions with uv build, validates metadata with twine, and publishes using PyPI's trusted publishing mechanism (OIDC).

https://claude.ai/code/session_0164biHHCtEyoZnDTJfRbuKE

Builds sdist and wheel with `uv build`, validates metadata via twine,
and publishes via `uv publish` with PyPI Trusted Publishing (OIDC).
Triggers on `v*` tag pushes, GitHub releases, or manual dispatch.
Copilot AI review requested due to automatic review settings April 29, 2026 04:44
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@CodeHalwell CodeHalwell merged commit cccca38 into master Apr 29, 2026
7 checks passed
@CodeHalwell CodeHalwell deleted the claude/ci-cd-pypi-uv-YmzIN branch April 29, 2026 04:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to build Python distributions and publish power-pptx to PyPI using trusted publishing (OIDC), enabling automated releases from Git tags / GitHub releases / manual dispatch.

Changes:

  • Add .github/workflows/publish.yml workflow with separate build + publish jobs.
  • Build sdist/wheel via uv build, validate via twine check, and publish via uv publish with OIDC.

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

Comment on lines +3 to +9
on:
push:
tags:
- "v*"
release:
types: [published]
workflow_dispatch:
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The workflow is configured to run on both tag pushes (v*) and published releases. If a GitHub release is created for a tag, this can trigger two runs for the same version and attempt to publish twice, which will typically fail on the second run (files already exist) or create confusing noise. Consider choosing a single trigger (tag or release), or add a guard/concurrency so only one publish run can proceed per tag/version.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +53
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

In publish-pypi, the job-level permissions block sets only id-token: write, which disables other token permissions. actions/download-artifact typically requires actions: read (and many repos also keep contents: read) to fetch artifacts; with the current permissions, this step may fail at runtime. Add the minimal required permissions alongside id-token: write so artifact download and publishing can succeed.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 556101fb3a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +4 to +8
push:
tags:
- "v*"
release:
types: [published]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent double-publishing on release and tag events

This workflow publishes on both push.tags and release.published, so a normal release process that pushes vX.Y.Z and then publishes a GitHub Release for the same tag will run this pipeline twice. The second run will attempt to upload an already-published version to PyPI, which is rejected, leaving the release workflow red even though the first publish succeeded. Consider choosing one trigger or adding an event/ref guard so each version is published exactly once.

Useful? React with 👍 / 👎.

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