File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Setup Python
2+ description : Setup Python
3+
4+ inputs :
5+ python-version :
6+ description : Python version
7+ required : false
8+ default : " 3.10"
9+
10+ runs :
11+ using : " composite"
12+ steps :
13+ - uses : pdm-project/setup-pdm@v3
14+ name : Setup PDM
15+ with :
16+ python-version : ${{ inputs.python-version }}
17+ architecture : " x64"
18+ cache : true
19+
20+ - run : pdm sync -G:all
21+ shell : bash
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - v*
7+
8+ jobs :
9+ pypi-publish :
10+ name : upload release to PyPI
11+ runs-on : ubuntu-latest
12+ permissions :
13+ id-token : write
14+ contents : write
15+ steps :
16+ - uses : actions/checkout@v3
17+
18+ - name : Setup Python environment
19+ uses : ./.github/actions/setup-python
20+
21+ - name : Get Version
22+ id : version
23+ run : |
24+ echo "VERSION=$(pdm show --version)" >> $GITHUB_OUTPUT
25+ echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
26+ echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
27+
28+ - name : Check Version
29+ if : steps.version.outputs.VERSION != steps.version.outputs.TAG_VERSION
30+ run : exit 1
31+
32+ - name : Publish Package
33+ run : |
34+ pdm publish
35+ gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl
36+ env :
37+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments