Skip to content

Commit fc6e7a5

Browse files
committed
publish replayer python & go to github registry
1 parent c3ea65f commit fc6e7a5

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

.github/workflows/publish-go-package.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ jobs:
4646
cd replayer-adapter-go
4747
go build -v ./...
4848
49+
- name: Create release assets
50+
if: startsWith(github.ref, 'refs/tags/replayer-adapter-go-v')
51+
run: |
52+
cd replayer-adapter-go
53+
# Create a source archive
54+
tar -czf temporal-replayer-adapter-go-${{ github.ref_name }}.tar.gz --exclude='.git' --exclude='*.tar.gz' .
55+
4956
- name: Create GitHub Release
5057
if: startsWith(github.ref, 'refs/tags/replayer-adapter-go-v')
5158
uses: actions/create-release@v1
@@ -67,16 +74,32 @@ jobs:
6774
6875
### Installation
6976
77+
#### From GitHub (Recommended)
7078
```bash
7179
go get github.com/phuongdnguyen/temporal-workflow-replay-debugger/replayer-adapter-go@${{ github.ref_name }}
7280
```
81+
82+
#### From GitHub Packages
83+
```bash
84+
# Configure GOPROXY for GitHub Packages
85+
export GOPROXY=https://proxy.golang.org,direct
86+
go get github.com/phuongdnguyen/temporal-workflow-replay-debugger/replayer-adapter-go@${{ github.ref_name }}
87+
```
88+
89+
### Usage
90+
91+
```go
92+
import "github.com/phuongdnguyen/temporal-workflow-replay-debugger/replayer-adapter-go"
93+
```
7394
draft: false
7495
prerelease: false
96+
files: |
97+
replayer-adapter-go/temporal-replayer-adapter-go-${{ github.ref_name }}.tar.gz
7598
7699
- name: Manual release creation
77100
if: github.event_name == 'workflow_dispatch'
78101
run: |
79102
echo "Manual release triggered for version: ${{ github.event.inputs.version }}"
80103
echo "To create a release, push a tag with the version:"
81-
echo "git tag v${{ github.event.inputs.version }}"
82-
echo "git push origin v${{ github.event.inputs.version }}"
104+
echo "git tag replayer-adapter-go-v${{ github.event.inputs.version }}"
105+
echo "git push origin replayer-adapter-go-v${{ github.event.inputs.version }}"

.github/workflows/publish-python-package.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
python -m pytest tests/ -v
4242
continue-on-error: true
4343

44+
# Publish to PyPI
4445
- name: Publish to PyPI
4546
if: startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
4647
run: |
@@ -50,6 +51,17 @@ jobs:
5051
TWINE_USERNAME: __token__
5152
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5253

54+
# Publish to GitHub Packages
55+
- name: Publish to GitHub Packages
56+
if: startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
57+
run: |
58+
cd replayer-adapter-python
59+
python -m twine upload --repository github dist/*
60+
env:
61+
TWINE_USERNAME: __token__
62+
TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
63+
64+
# Manual publish to PyPI
5365
- name: Manual publish to PyPI
5466
if: github.event_name == 'workflow_dispatch'
5567
run: |
@@ -64,6 +76,21 @@ jobs:
6476
TWINE_USERNAME: __token__
6577
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
6678

79+
# Manual publish to GitHub Packages
80+
- name: Manual publish to GitHub Packages
81+
if: github.event_name == 'workflow_dispatch'
82+
run: |
83+
cd replayer-adapter-python
84+
# Update version in pyproject.toml if provided
85+
if [ -n "${{ github.event.inputs.version }}" ]; then
86+
sed -i 's/version = ".*"/version = "${{ github.event.inputs.version }}"/' pyproject.toml
87+
fi
88+
python -m build
89+
python -m twine upload --repository github dist/*
90+
env:
91+
TWINE_USERNAME: __token__
92+
TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
93+
6794
- name: Create GitHub Release
6895
if: startsWith(github.ref, 'refs/tags/replayer-adapter-python-v')
6996
uses: actions/create-release@v1
@@ -81,5 +108,8 @@ jobs:
81108
82109
- Version: ${{ github.ref_name }}
83110
- 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`
84114
draft: false
85115
prerelease: false

replayer-adapter-python/pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ Repository = "https://github.com/phuongdnguyen/temporal-workflow-replay-debugger
3636
Issues = "https://github.com/phuongdnguyen/temporal-workflow-replay-debugger/issues"
3737
Documentation = "https://github.com/phuongdnguyen/temporal-workflow-replay-debugger/blob/main/replayer-adapter-python/README.md"
3838

39+
# GitHub Packages configuration
40+
[tool.twine.repository.pypi]
41+
username = "__token__"
42+
password = "${{ secrets.PYPI_TOKEN }}"
43+
44+
[tool.twine.repository.github]
45+
repository = "https://github.com/phuongdnguyen/temporal-workflow-replay-debugger"
46+
username = "__token__"
47+
password = "${{ secrets.GITHUB_TOKEN }}"
48+
3949
[project.optional-dependencies]
4050
dev = [
4151
"pytest>=6.0",

0 commit comments

Comments
 (0)