Skip to content

Add minimal CHANGELOG entry to sdk-python documenting current state (#3) #12

Add minimal CHANGELOG entry to sdk-python documenting current state (#3)

Add minimal CHANGELOG entry to sdk-python documenting current state (#3) #12

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (build only, no publish)'
required: false
type: boolean
default: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build tools
run: pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Smoke test built package
run: python scripts/smoke-built-package.py
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
print-hash: true
publish-test:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && !inputs.dry_run
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
print-hash: true