Skip to content

Commit cf14fd6

Browse files
[Fixes #27] add official pip package
2 parents c2fad3b + 04b1981 commit cf14fd6

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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/*

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = 'geonodectl'
11-
version="0.2.1"
11+
version="0.2.2"
1212
description="a commandline interface tool for Geonode Rest API v2"
1313
authors = [{ name = "marcel wallschlaeger", email="marcel.wallschlaeger@zalf.de" }]
1414
readme = "README.md"

0 commit comments

Comments
 (0)