1+ name : Publish Python Package
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+ branches :
8+ - main
9+ workflow_dispatch :
10+ inputs :
11+ version :
12+ description : ' Package version to publish (e.g., 1.0.0)'
13+ required : true
14+ type : string
15+
16+ jobs :
17+ publish :
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Set up Python
25+ uses : actions/setup-python@v4
26+ with :
27+ python-version : ' 3.11'
28+
29+ - name : Install build dependencies
30+ run : |
31+ python -m pip install --upgrade pip
32+ pip install build twine
33+
34+ - name : Build package
35+ run : |
36+ cd replayer-adapter-python
37+ python -m build
38+
39+ - name : Run tests (if available)
40+ run : |
41+ cd replayer-adapter-python
42+ pip install -e ".[dev]"
43+ python -m pytest tests/ -v
44+ continue-on-error : true
45+
46+ - name : Publish to PyPI
47+ if : startsWith(github.ref, 'refs/tags/v')
48+ run : |
49+ cd replayer-adapter-python
50+ python -m twine upload --repository pypi dist/*
51+ env :
52+ TWINE_USERNAME : __token__
53+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
54+
55+ - name : Manual publish to PyPI
56+ if : github.event_name == 'workflow_dispatch'
57+ run : |
58+ cd replayer-adapter-python
59+ # Update version in pyproject.toml if provided
60+ if [ -n "${{ github.event.inputs.version }}" ]; then
61+ sed -i 's/version = ".*"/version = "${{ github.event.inputs.version }}"/' pyproject.toml
62+ fi
63+ python -m build
64+ python -m twine upload --repository pypi dist/*
65+ env :
66+ TWINE_USERNAME : __token__
67+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
68+
69+ - name : Create GitHub Release
70+ if : startsWith(github.ref, 'refs/tags/v')
71+ uses : actions/create-release@v1
72+ env :
73+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74+ with :
75+ tag_name : ${{ github.ref }}
76+ release_name : Release ${{ github.ref }}
77+ body : |
78+ ## Changes in this release
79+
80+ This release includes updates to the Temporal Workflow Debugger Python replayer adapter.
81+
82+ ### Package: temporal-replayer-adapter-python
83+
84+ - Version: ${{ github.ref_name }}
85+ - Built from commit: ${{ github.sha }}
86+ draft : false
87+ prerelease : false
0 commit comments