Skip to content

Commit e0aa5e2

Browse files
authored
[feat] tag releases automatically
1 parent 3b00143 commit e0aa5e2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: publish
22

3-
on: [push, workflow_dispatch]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
48

59
jobs:
610
diff:
@@ -25,6 +29,7 @@ jobs:
2529
environment: release
2630
if: needs.diff.outputs.CHANGED == 'true'
2731
permissions:
32+
contents: write
2833
id-token: write
2934
steps:
3035
- uses: actions/checkout@v4
@@ -36,6 +41,10 @@ jobs:
3641
run: |
3742
python src/overrides.py 3.6
3843
uv build
44+
- name: Create GitHub release
45+
run: |
46+
VERSION="$(grep -m1 -oP '^__version__\s*=\s*"\K[^"]+' src/partial_json_parser/version.py)"
47+
gh release create v$VERSION --title=v$VERSION --generate-notes dist/*
3948
- name: Publish to PyPI
40-
continue-on-error: true
49+
if: ${{ github.repository == 'promplate/partial-json-parser' }}
4150
run: uv publish

0 commit comments

Comments
 (0)