Skip to content

Commit

Permalink
Release of version 1.0.0 (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Koppen <[email protected]>
  • Loading branch information
vincentkoppen authored Jan 17, 2025
1 parent 7e5d6b8 commit 2fc8fee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build-test-and-sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,20 @@ jobs:
name: power-grid-model-ds
path: wheelhouse/

# - name: Upload wheels
# if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
# run: |
# pip install twine
# echo "Publish to PyPI..."
# twine upload --verbose wheelhouse/*

# - name: Release
# if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
# uses: softprops/action-gh-release@v2
# with:
# files: |
# ./wheelhouse/*
# tag_name: v${{ needs.build-python.outputs.version }}
# prerelease: ${{github.ref != 'refs/heads/main'}}
# generate_release_notes: true
# target_commitish: ${{ github.sha }}
- name: Upload wheels
if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
run: |
pip install twine
echo "Publish to PyPI..."
twine upload --verbose wheelhouse/*
- name: Release
if: (github.event_name == 'push') || ((github.event_name == 'workflow_dispatch') && (github.event.inputs.create_release == 'true'))
uses: softprops/action-gh-release@v2
with:
files: |
./wheelhouse/*
tag_name: v${{ needs.build-python.outputs.version }}
prerelease: ${{github.ref != 'refs/heads/main'}}
generate_release_notes: true
target_commitish: ${{ github.sha }}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0
1.0
11 changes: 8 additions & 3 deletions set_pypi_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


import os
import re
from pathlib import Path

import requests
Expand Down Expand Up @@ -44,9 +45,13 @@ def get_pypi_latest():
response = requests.get("https://pypi.org/pypi/power-grid-model-ds/json")
if response.status_code == 404:
return 0, 0, 0
data = response.json()
version = str(data["info"]["version"])
return (int(x) for x in version.split("."))
version = str(response.json()["info"]["version"])

version_pattern = re.compile(r"^\d+\.\d+\.\d+")
match = version_pattern.match(version)
if not match:
raise ValueError(f"Invalid version format: {version}")
return (int(x) for x in match.group(0).split("."))


def get_new_version(major, minor, latest_major, latest_minor, latest_patch):
Expand Down

0 comments on commit 2fc8fee

Please sign in to comment.