@@ -51,15 +51,17 @@ jobs:
5151 TWINE_USERNAME : __token__
5252 TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
5353
54- # Publish to GitHub Packages
55- - name : Publish to GitHub Packages
54+ # Prepare package for GitHub Release
55+ - name : Prepare package for GitHub Release
5656 if : startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
5757 run : |
5858 cd replayer-adapter-python
59- python -m twine upload --repository github dist/*
60- env :
61- TWINE_USERNAME : __token__
62- TWINE_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
59+ # Create a source distribution if not already created
60+ if [ ! -d "dist" ]; then
61+ python -m build
62+ fi
63+ # List the built packages
64+ ls -la dist/
6365
6466 # Manual publish to PyPI
6567 - name : Manual publish to PyPI
7678 TWINE_USERNAME : __token__
7779 TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
7880
79- # Manual publish to GitHub Packages
80- - name : Manual publish to GitHub Packages
81+ # Manual prepare package for GitHub Release
82+ - name : Manual prepare package for GitHub Release
8183 if : github.event_name == 'workflow_dispatch'
8284 run : |
8385 cd replayer-adapter-python
@@ -86,13 +88,11 @@ jobs:
8688 sed -i 's/version = ".*"/version = "${{ github.event.inputs.version }}"/' pyproject.toml
8789 fi
8890 python -m build
89- python -m twine upload --repository github dist/*
90- env :
91- TWINE_USERNAME : __token__
92- TWINE_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
91+ ls -la dist/
9392
9493 - name : Create GitHub Release
9594 if : startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
95+ id : create_release
9696 uses : actions/create-release@v1
9797 env :
9898 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -108,8 +108,40 @@ jobs:
108108
109109 - Version: ${{ github.ref_name }}
110110 - Built from commit: ${{ github.sha }}
111- - Available on:
112- - PyPI: `pip install temporal-replayer-adapter-python`
113- - GitHub Packages: `pip install temporal-replayer-adapter-python --index-url https://pypi.github.com/phuongdnguyen/temporal-workflow-replay-debugger`
111+
112+ ### Installation
113+
114+ #### From PyPI (Recommended)
115+ ```bash
116+ pip install temporal-replayer-adapter-python
117+ ```
118+
119+ #### From GitHub Release
120+ Download the wheel or source distribution from the release assets below and install:
121+ ```bash
122+ pip install temporal_replayer_adapter_python-${{ github.ref_name }}-py3-none-any.whl
123+ # or
124+ pip install temporal-replayer-adapter-python-${{ github.ref_name }}.tar.gz
125+ ```
114126 draft : false
115- prerelease : false
127+ prerelease : false
128+
129+ - name : Upload Python Package Assets to Release
130+ if : startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
131+ run : |
132+ cd replayer-adapter-python
133+ # Upload all built packages to the release
134+ for file in dist/*; do
135+ if [ -f "$file" ]; then
136+ filename=$(basename "$file")
137+ echo "Uploading $filename to release..."
138+ curl -L \
139+ -X POST \
140+ -H "Accept: application/vnd.github+json" \
141+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
142+ -H "X-GitHub-Api-Version: 2022-11-28" \
143+ -H "Content-Type: application/octet-stream" \
144+ "${{ steps.create_release.outputs.upload_url }}?name=$filename" \
145+ --data-binary "@$file"
146+ fi
147+ done
0 commit comments