File tree Expand file tree Collapse file tree 3 files changed +73
-1
lines changed
Expand file tree Collapse file tree 3 files changed +73
-1
lines changed Original file line number Diff line number Diff line change 1+
2+ name : Create Release on Version Change
3+
4+ on :
5+ push :
6+ branches :
7+ - main
8+ paths :
9+ - pyproject.toml
10+ workflow_dispatch :
11+
12+ jobs :
13+ release :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Get current version from pyproject.toml
20+ id : get_version
21+ run : |
22+ VERSION=$(grep '^version' pyproject.toml | head -n1 | awk -F '"' '{print $2}')
23+ echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
25+ - name : Get latest release version
26+ id : get_latest_release
27+ run : |
28+ LATEST=$(gh release list --limit 1 | awk '{print $1}')
29+ echo "latest=$LATEST" >> $GITHUB_OUTPUT
30+ env :
31+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32+
33+ - name : Create Release if version changed
34+ if : steps.get_version.outputs.version != steps.get_latest_release.outputs.latest
35+ run : |
36+ gh release create "${{ steps.get_version.outputs.version }}" --title "Release ${{ steps.get_version.outputs.version }}" --notes "Automated release for version ${{ steps.get_version.outputs.version }}"
37+ env :
38+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Publish Python 🐍 package to PyPI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ build-and-publish :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v5
18+ with :
19+ python-version : ' 3.10'
20+
21+ - name : Install build tools
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install build twine
25+
26+ - name : Build package
27+ run : |
28+ python -m build
29+
30+ - name : Publish to PyPI
31+ env :
32+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
33+ run : |
34+ twine upload -u __token__ -p $TWINE_PASSWORD dist/*
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88
99[project ]
1010name = ' geonodectl'
11- version =" 0.2.1 "
11+ version =" 0.2.2 "
1212description =" a commandline interface tool for Geonode Rest API v2"
1313authors = [{ name = " marcel wallschlaeger" , email =" marcel.wallschlaeger@zalf.de" }]
1414readme = " README.md"
You can’t perform that action at this time.
0 commit comments