File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Create Release on Pyproject Version Change
2+ # Automatically create a release when a version specified in a pyproject.toml is changed.
3+
4+ on :
5+ workflow_call :
6+
7+ jobs :
8+ create-release :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+
15+ - name : Install uv
16+ uses : astral-sh/setup-uv@v5
17+
18+ - name : Determine Version Change
19+ id : version_check
20+ run : |
21+ VERSION="v$(uv version --short)"
22+ echo "Current version: $VERSION"
23+
24+ LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
25+ https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')
26+ echo "Latest release version: $LATEST_RELEASE"
27+
28+ if [ "$VERSION" != "$LATEST_RELEASE" ]; then
29+ echo "version_changed=true" >> $GITHUB_OUTPUT
30+ echo "new_version=$VERSION" >> $GITHUB_OUTPUT
31+ else
32+ echo "version_changed=false" >> $GITHUB_OUTPUT
33+ fi
34+
35+ - name : Create Release
36+ if : steps.version_check.outputs.version_changed == 'true'
37+ uses : softprops/action-gh-release@v1
38+ with :
39+ tag_name : ${{ steps.version_check.outputs.new_version }}
40+ generate_release_notes : true
You can’t perform that action at this time.
0 commit comments