-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add a GitHub Actions workflow to automatically publish releases to PyPI when a version tag is pushed.
Prerequisites
- Register
forge-anvilpackage name on PyPI - Configure Trusted Publisher on PyPI (recommended) OR generate API token
Setting up Trusted Publishers (Recommended)
- Create/login to PyPI account at https://pypi.org
- Go to: Account → Publishing → Add a new pending publisher
- Configure:
- PyPI Project Name:
forge-anvil - Owner:
agentic-forge - Repository:
forge-anvil - Workflow name:
release.yml - Environment:
pypi(optional but recommended)
- PyPI Project Name:
Implementation
Create .github/workflows/release.yml:
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
run: uv python install
- name: Build package
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # Required for trusted publishing
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1Release Process
Once configured, to release a new version:
# Update version in pyproject.toml
# Commit the change
git tag v0.1.0
git push origin v0.1.0Acceptance Criteria
- PyPI account created and package name registered
- Trusted Publisher configured on PyPI
- Release workflow triggers on version tags
- Package successfully publishes to PyPI
Metadata
Metadata
Assignees
Labels
No labels