Skip to content

Merge pull request #21 from runcycles/claude/yaml-protocol-updates-YJqXi #16

Merge pull request #21 from runcycles/claude/yaml-protocol-updates-YJqXi

Merge pull request #21 from runcycles/claude/yaml-protocol-updates-YJqXi #16

Workflow file for this run

name: Publish Python package
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
target:
description: "Where to publish"
required: true
default: "testpypi"
type: choice
options:
- testpypi
- pypi
jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build tool
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build
- name: Upload distribution artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish to TestPyPI
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi'
environment:
name: testpypi
url: https://test.pypi.org/p/runcycles
permissions:
id-token: write
contents: read
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi')
environment:
name: pypi
url: https://pypi.org/p/runcycles
permissions:
id-token: write
contents: read
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1