File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ name: Publish NuGet Packages
22on :
33 push :
44 branches : [ main ]
5+ workflow_dispatch :
6+ inputs :
7+ version :
8+ description : ' Package Version (leave blank to auto-increment patch)'
9+ required : false
10+ type : string
11+ default : ' '
512
613jobs :
714 publish :
@@ -15,15 +22,19 @@ jobs:
1522 - name : Compute Next Version
1623 id : version
1724 run : |
18- latest=$(git tag --list 'v*' --sort=-version:refname | head -n 1)
19- if [ -z "$latest" ]; then
20- next="1.0.0"
25+ if [ -n "${{ github.event.inputs.version }}" ]; then
26+ next="${{ github.event.inputs.version }}"
2127 else
22- version="${latest#v}"
23- major=$(echo "$version" | cut -d. -f1)
24- minor=$(echo "$version" | cut -d. -f2)
25- patch=$(echo "$version" | cut -d. -f3)
26- next="${major}.${minor}.$((patch + 1))"
28+ latest=$(git tag --list 'v*' --sort=-version:refname | head -n 1)
29+ if [ -z "$latest" ]; then
30+ next="1.0.0"
31+ else
32+ version="${latest#v}"
33+ major=$(echo "$version" | cut -d. -f1)
34+ minor=$(echo "$version" | cut -d. -f2)
35+ patch=$(echo "$version" | cut -d. -f3)
36+ next="${major}.${minor}.$((patch + 1))"
37+ fi
2738 fi
2839 echo "version=${next}" >> "$GITHUB_OUTPUT"
2940
You can’t perform that action at this time.
0 commit comments