Skip to content

Commit

Permalink
Merge pull request #88 from carlos-rian/release/bugfix-generate_rando…
Browse files Browse the repository at this point in the history
…m_key

Release/bugfix generate random key
  • Loading branch information
carlos-rian authored Oct 15, 2024
2 parents 986da9b + 998af54 commit b6df9f5
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 39 deletions.
25 changes: 8 additions & 17 deletions .github/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@


def get_version():
uri = "https://pypi.org/pypi/pysqlx-core/json"
for _ in range(3):
resp = httpx.get("https://pypi.org/pypi/pysqlx-core/json")
if resp.status_code == 200:
resp = httpx.get(uri)
if resp.is_success:
break
data: dict = resp.json()
json: dict = resp.json()

releases = data["releases"]
releases = json["releases"]
versions = sorted(
releases.keys(),
key=lambda x: int(x.replace(".", "").replace("b", "").replace("a", "")),
key=lambda x: int(x.replace(".", "").replace("b", "")),
reverse=True,
)
versions = [v for v in versions if "b" in v]

current_version = data["info"]["version"]

if versions:
if int(current_version.replace(".", "")) > int(
versions[0].split("b")[0].replace(".", "")
):
return current_version
return versions[0]

return current_version
versions = [v for v in versions if v.startswith("0.2.0") and "b" in v]
return versions.pop() if versions else "0.2.0b-1"


version: str = get_version()
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- "main"
- "release/*"
- "deps/*"

paths-ignore:
Expand Down Expand Up @@ -62,6 +61,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- run: pip install -U toml httpx

- name: production - check package version
Expand Down
Loading

0 comments on commit b6df9f5

Please sign in to comment.