File tree Expand file tree Collapse file tree 1 file changed +81
-0
lines changed
Expand file tree Collapse file tree 1 file changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Publish to PyPI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - master
8+ tags :
9+ - ' v*'
10+ workflow_dispatch :
11+
12+ jobs :
13+ build :
14+ name : Build distribution
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : ' 3.x'
25+
26+ - name : Install build dependencies
27+ run : |
28+ python -m pip install --upgrade pip
29+ pip install build
30+
31+ - name : Build package
32+ run : python -m build
33+
34+ - name : Store the distribution packages
35+ uses : actions/upload-artifact@v4
36+ with :
37+ name : python-package-distributions
38+ path : dist/
39+
40+ publish-to-pypi :
41+ name : Publish to PyPI
42+ needs : build
43+ runs-on : ubuntu-latest
44+ environment :
45+ name : pypi
46+ url : https://pypi.org/p/llm_session
47+ permissions :
48+ id-token : write
49+
50+ steps :
51+ - name : Download all the dists
52+ uses : actions/download-artifact@v4
53+ with :
54+ name : python-package-distributions
55+ path : dist/
56+
57+ - name : Publish distribution to PyPI
58+ uses : pypa/gh-action-pypi-publish@release/v1
59+
60+ publish-to-testpypi :
61+ name : Publish to TestPyPI
62+ needs : build
63+ runs-on : ubuntu-latest
64+ if : github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
65+ environment :
66+ name : testpypi
67+ url : https://test.pypi.org/p/llm_session
68+ permissions :
69+ id-token : write
70+
71+ steps :
72+ - name : Download all the dists
73+ uses : actions/download-artifact@v4
74+ with :
75+ name : python-package-distributions
76+ path : dist/
77+
78+ - name : Publish distribution to TestPyPI
79+ uses : pypa/gh-action-pypi-publish@release/v1
80+ with :
81+ repository-url : https://test.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments