1+ name : Publish deepset-mcp distribution to PyPI and TestPyPI
2+ on :
3+ push :
4+ tags :
5+ - ' v*.*.*' # matches v1.0.0, v0.10.0, etc.
6+ - ' v*.*.*-rc*' # matches v1.0.2-rc1, v0.10.0-rc2, etc.
7+ jobs :
8+ build :
9+ name : Build distribution
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ persist-credentials : false
15+ - name : Set up Python
16+ uses : actions/setup-python@v5
17+ with :
18+ python-version : " 3.x"
19+ - name : Install uv
20+ run : >-
21+ curl -LsSf https://astral.sh/uv/install.sh | sh &&
22+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
23+ - name : Build a binary wheel and a source tarball
24+ run : uv build
25+ - name : Store the distribution packages
26+ uses : actions/upload-artifact@v4
27+ with :
28+ name : python-package-distributions
29+ path : dist/
30+ publish-to-pypi :
31+ name : >-
32+ Publish deepset-mcp distribution to PyPI
33+ if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+ needs :
35+ - build
36+ runs-on : ubuntu-latest
37+ environment :
38+ name : pypi
39+ url : https://pypi.org/p/deepset-mcp
40+ permissions :
41+ id-token : write # IMPORTANT: mandatory for trusted publishing
42+ steps :
43+ - name : Download all the dists
44+ uses : actions/download-artifact@v4
45+ with :
46+ name : python-package-distributions
47+ path : dist/
48+ - name : Publish distribution to PyPI
49+ uses : pypa/gh-action-pypi-publish@release/v1
50+ publish-to-testpypi :
51+ name : Publish deepset-mcp distribution to TestPyPI
52+ if : startsWith(github.ref, 'refs/tags/') # only publish to TestPyPI on tag pushes
53+ needs :
54+ - build
55+ runs-on : ubuntu-latest
56+ environment :
57+ name : testpypi
58+ url : https://test.pypi.org/p/deepset-mcp
59+ permissions :
60+ id-token : write # IMPORTANT: mandatory for trusted publishing
61+ steps :
62+ - name : Download all the dists
63+ uses : actions/download-artifact@v4
64+ with :
65+ name : python-package-distributions
66+ path : dist/
67+ - name : Publish distribution to TestPyPI
68+ uses : pypa/gh-action-pypi-publish@release/v1
69+ with :
70+ repository-url : https://test.pypi.org/legacy/
0 commit comments