This repository was archived by the owner on Aug 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
Expand file tree Collapse file tree 2 files changed +52
-0
lines changed 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
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+ release :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v3
13+
14+ - name : Setup Python environment
15+ uses : ./.github/actions/setup-python
16+
17+ - name : Get Version
18+ id : version
19+ run : |
20+ echo "VERSION=$(pdm show --version)" >> $GITHUB_OUTPUT
21+ echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
22+ echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
23+
24+ - name : Check Version
25+ if : steps.version.outputs.VERSION != steps.version.outputs.TAG_VERSION
26+ run : exit 1
27+
28+ - name : Build and Publish Package
29+ run : |
30+ pdm build
31+ pdm publish -u __token__ -P ${{ secrets.PYPI_TOKEN }}
32+ gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments