File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed
Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 11name : publish
22
3- on : [push, workflow_dispatch]
3+ # Note: this workflow evaluates Python code from this repository.
4+ # It therefore must not be run on untrusted input (e.g. on pull requests).
5+ # But that's fine, because we only want to publish when the default branch
6+ # is pushed to (or when a maintainer manually runs this workflow) anyways.
7+ on :
8+ push :
9+ branches :
10+ - with-action
11+ workflow_dispatch :
412
513jobs :
614 diff :
2533 environment : release
2634 if : needs.diff.outputs.CHANGED == 'true'
2735 permissions :
36+ contents : write
2837 id-token : write
2938 steps :
3039 - uses : actions/checkout@v4
3746 python src/overrides.py 3.6
3847 uv build
3948 - name : Publish to PyPI
40- continue-on-error : true
49+ if : env.GITHUB_REPOSITORY == 'promplate/partial-json-parser'
4150 run : uv publish
51+ - name : Read version number
52+ id : read-version
53+ run : |
54+ cd src/partial_json_parser
55+ VERSION="$(python -c 'from version import __version__; print(__version__)')"
56+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
57+ - name : Publish GitHub release
58+ env :
59+ GH_TOKEN : ${{ github.token }}
60+ VERSION : ${{ steps.read-version.outputs.VERSION }}
61+ run : |
62+ gh release create "v$VERSION" \
63+ --repo="$GITHUB_REPOSITORY" \
64+ --title="${VERSION#v}" \
65+ --generate-notes
You can’t perform that action at this time.
0 commit comments