77 release :
88 types : [published]
99
10- jobs :
11- deploy :
12- runs-on : windows-latest
10+ jobs :
11+ build :
12+ name : Build distribution
13+ runs-on : ubuntu-latest
1314 steps :
14- - uses : actions/checkout@v2
15+ - uses : actions/checkout@v4
1516 - name : Set up Python
16- uses : actions/setup-python@v2
17+ uses : actions/setup-python@v5
1718 with :
18- python-version : ' 3.x'
19- - name : Install dependencies
20- run : |
21- python -m pip install --upgrade pip
22- python -m pip install --user --upgrade setuptools wheel
23- python setup.py sdist bdist_wheel
24- pip install setuptools wheel twine
25- - name : Build and publish
19+ python-version : " 3.x"
20+ - name : Install pypa/build
21+ run : python3 -m pip install build
22+ - name : Build a binary wheel and a source tarball
23+ run : python3 -m build
24+ - name : Store the distribution packages
25+ uses : actions/upload-artifact@v3
26+ with :
27+ name : python-package-distributions
28+ path : dist/
29+
30+ pypi-publish :
31+ name : Publish Python distribution to PyPI
32+ runs-on : ubuntu-latest
33+ environment :
34+ name : pypi
35+ url : https://pypi.org/p/cm-text-sdk-python
36+ permissions :
37+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
38+ contents : read # Add the contents permission for accessing repository contents
39+ steps :
40+ - name : Download all the dists
41+ uses : actions/download-artifact@v3
42+ with :
43+ name : python-package-distributions
44+ path : dist/
45+ - name : Publish package distributions to PyPI
2646 env :
27- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
28- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
47+ TWINE_USERNAME : __token__
48+ TWINE_PASSWORD : ${{ secrets.PYPI_API_PUBLISH_TOKEN }}
2949 run : |
30- python setup.py sdist bdist_wheel
31- python -m pip install --user --upgrade twine
32- python -m twine upload --repository pypi dist/*
50+ python3 -m pip install twine
51+ twine upload dist/*
0 commit comments