Skip to content

Commit 2fc8fee

Browse files
Release of version 1.0.0 (#4)
Signed-off-by: Vincent Koppen <[email protected]>
1 parent 7e5d6b8 commit 2fc8fee

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

.github/workflows/build-test-and-sonar.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,20 @@ jobs:
152152
name: power-grid-model-ds
153153
path: wheelhouse/
154154

155-
# - name: Upload wheels
156-
# if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
157-
# run: |
158-
# pip install twine
159-
# echo "Publish to PyPI..."
160-
# twine upload --verbose wheelhouse/*
161-
162-
# - name: Release
163-
# if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
164-
# uses: softprops/action-gh-release@v2
165-
# with:
166-
# files: |
167-
# ./wheelhouse/*
168-
# tag_name: v${{ needs.build-python.outputs.version }}
169-
# prerelease: ${{github.ref != 'refs/heads/main'}}
170-
# generate_release_notes: true
171-
# target_commitish: ${{ github.sha }}
155+
- name: Upload wheels
156+
if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
157+
run: |
158+
pip install twine
159+
echo "Publish to PyPI..."
160+
twine upload --verbose wheelhouse/*
161+
162+
- name: Release
163+
if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
164+
uses: softprops/action-gh-release@v2
165+
with:
166+
files: |
167+
./wheelhouse/*
168+
tag_name: v${{ needs.build-python.outputs.version }}
169+
prerelease: ${{github.ref != 'refs/heads/main'}}
170+
generate_release_notes: true
171+
target_commitish: ${{ github.sha }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0
1+
1.0

set_pypi_version.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
import os
10+
import re
1011
from pathlib import Path
1112

1213
import requests
@@ -44,9 +45,13 @@ def get_pypi_latest():
4445
response = requests.get("https://pypi.org/pypi/power-grid-model-ds/json")
4546
if response.status_code == 404:
4647
return 0, 0, 0
47-
data = response.json()
48-
version = str(data["info"]["version"])
49-
return (int(x) for x in version.split("."))
48+
version = str(response.json()["info"]["version"])
49+
50+
version_pattern = re.compile(r"^\d+\.\d+\.\d+")
51+
match = version_pattern.match(version)
52+
if not match:
53+
raise ValueError(f"Invalid version format: {version}")
54+
return (int(x) for x in match.group(0).split("."))
5055

5156

5257
def get_new_version(major, minor, latest_major, latest_minor, latest_patch):

0 commit comments

Comments
 (0)