Skip to content

Commit

Permalink
[feat] add version file and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jan 8, 2025
1 parent 5093684 commit a856346
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish

on: [push, workflow_dispatch]

jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for changes
id: changes-check
run: |
if git diff --quiet HEAD~1 HEAD -- src/partial_json_parser/version.py; then
echo "CHANGED=false" >> $GITHUB_OUTPUT
else
echo "CHANGED=true" >> $GITHUB_OUTPUT
fi
outputs:
CHANGED: ${{ steps.changes-check.outputs.CHANGED }}
pypi:
runs-on: ubuntu-latest
needs: diff
if: needs.diff.outputs.CHANGED == 'true'
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: src/python/common
- name: Set up python
uses: astral-sh/setup-uv@v5
with:
python-version: 3.13
- name: Build package
run: uv build
- name: Publish to PyPI
continue-on-error: true
run: uv publish
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "partial-json-parser"
version = "0.2.1.1.post4"
dynamic = ["version"]
description = "Parse partial JSON generated by LLM"
authors = [{ name = "Muspi Merol", email = "[email protected]" }]
optional-dependencies = { playground = ["rich"] }
Expand Down Expand Up @@ -38,6 +38,9 @@ playground = { call = "partial_json_parser.playground:main" }
pre_build = { composite = ["format", "python src/overrides.py 3.6"] }
post_build = "python src/overrides.py 3.8"

[tool.pdm.version]
source = "file"
path = "src/partial_json_parser/version.py"

[tool.black]
line-length = 160
Expand Down
1 change: 1 addition & 0 deletions src/partial_json_parser/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.2.1.1.post5"

0 comments on commit a856346

Please sign in to comment.