File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Trigger this workflow for tags starting with "v"
7+
8+ jobs :
9+ build-and-publish :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v4
18+ with :
19+ python-version : 3.9 # Specify the Python version
20+
21+ - name : Install Poetry
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install poetry
25+
26+ - name : Extract version from tag
27+ id : get_version
28+ run : echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
29+
30+ - name : Update version in pyproject.toml
31+ run : poetry version ${{ env.version }}
32+
33+ - name : Install dependencies
34+ run : poetry install --no-root
35+
36+ - name : Build and Publish to PyPI
37+ env :
38+ POETRY_PYPI_TOKEN_PYPI : ${{ secrets.PYPI_API_TOKEN }}
39+ run : |
40+ poetry build
41+ poetry publish
You can’t perform that action at this time.
0 commit comments