1+ name : Durable Task SDK (durabletask)
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+ tags :
8+ - " v*" # Only run for tags starting with "v"
9+ pull_request :
10+ branches :
11+ - " main"
12+
13+ jobs :
14+ lint-and-unit-tests :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v4
18+ - name : Set up Python 3.12
19+ uses : actions/setup-python@v5
20+ with :
21+ python-version : 3.12
22+ - name : Install dependencies
23+ run : |
24+ python -m pip install --upgrade pip
25+ pip install setuptools wheel tox
26+ pip install flake8
27+ - name : Run flake8 Linter
28+ run : flake8 .
29+
30+ run-e2e-tests :
31+ needs : lint-and-unit-tests
32+ runs-on : ubuntu-latest
33+ steps :
34+ - name : Checkout repository
35+ uses : actions/checkout@v4
36+ # Sidecar for running e2e tests requires Go SDK
37+ - name : Install Go SDK
38+ uses : actions/setup-go@v5
39+ with :
40+ go-version : ' stable'
41+
42+ # Install and run the durabletask-go sidecar for running e2e tests
43+ - name : Pytest e2e tests
44+ working-directory : tests/durabletask
45+ run : |
46+ go install github.com/microsoft/durabletask-go@main
47+ durabletask-go --port 4001 &
48+ pytest -m "e2e and not dts" --verbose
49+
50+ publish :
51+ if : startsWith(github.ref, 'refs/tags/v') # Only run if a matching tag is pushed
52+ needs : run-e2e-tests
53+ runs-on : ubuntu-latest
54+ steps :
55+ - name : Checkout code
56+ uses : actions/checkout@v4
57+
58+ - name : Extract version from tag
59+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV # Extract version from the tag
60+
61+ - name : Set up Python
62+ uses : actions/setup-python@v5
63+ with :
64+ python-version : " 3.12" # Adjust Python version as needed
65+
66+ - name : Install dependencies
67+ run : |
68+ python -m pip install --upgrade pip
69+ pip install build twine
70+
71+ - name : Build package from root directory
72+ run : |
73+ python -m build
74+
75+ - name : Check package
76+ run : |
77+ twine check dist/*
78+
79+ - name : Publish package to PyPI
80+ env :
81+ TWINE_USERNAME : __token__
82+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }} # Store your PyPI API token in GitHub Secrets
83+ run : |
84+ twine upload dist/*
0 commit comments