File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1313 runs-on : ubuntu-latest
1414 permissions :
1515 contents : write
16+ outputs :
17+ tag : v${{ github.event.inputs.version }}
1618 steps :
1719 - name : Checkout code
1820 uses : actions/checkout@v4
2931 fi
3032
3133 # Update version in pyproject.toml
32- # This specifically targets the 'version = "..."' line in the [project] section
3334 sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
3435
3536 - name : Commit and push
4647 git push origin main
4748 fi
4849
49- # Tag and push tag (this will trigger release.yml)
50+ # Tag and push tag
5051 git tag "v$VERSION"
5152 git push origin "v$VERSION"
53+
54+ release :
55+ needs : prepare
56+ uses : ./.github/workflows/release.yml
57+ with :
58+ tag : ${{ needs.prepare.outputs.tag }}
59+ secrets : inherit
Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - ' v*'
7+ workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : ' Tag to release (e.g. v1.2.3)'
11+ required : true
12+ workflow_call :
13+ inputs :
14+ tag :
15+ description : ' Tag to release'
16+ required : true
17+ type : string
718
819jobs :
920 release :
@@ -31,14 +42,15 @@ jobs:
3142 env :
3243 GH_TOKEN : ${{ github.token }}
3344 run : |
34- gh release create ${{ github.ref_name }} \
45+ TAG=${{ inputs.tag || github.ref_name }}
46+ gh release create "$TAG" \
3547 dist/* \
3648 --generate-notes \
37- --title "Release ${{ github.ref_name }} "
49+ --title "Release $TAG "
3850
3951 - name : Update major version tag
4052 run : |
41- TAG=${{ github.ref_name }}
53+ TAG=${{ inputs.tag || github.ref_name }}
4254 # If tag is v1.2.3, MAJOR is v1
4355 if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
4456 MAJOR=${TAG%%.*}
You can’t perform that action at this time.
0 commit comments