File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish NuGet Packages
22on :
3- push :
4- branches : [ main ]
53 workflow_dispatch :
64 inputs :
75 version :
8- description : ' Package Version (leave blank to auto-increment patch)'
9- required : false
10- type : string
6+ description : ' Package Version'
7+ required : true
118 default : ' '
9+ workflow_run :
10+ workflows : ["Code Validation"]
11+ branches : [main]
12+ types : [completed]
1213
1314jobs :
1415 publish :
1516 name : Publish NuGet
1617 runs-on : ubuntu-latest
18+ if : >-
19+ github.event_name == 'workflow_dispatch' ||
20+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1721 steps :
1822 - uses : actions/checkout@v4
1923 with :
2226 - name : Compute Next Version
2327 id : version
2428 run : |
25- if [ -n "${{ github.event.inputs.version }}" ]; then
26- next=" ${{ github.event.inputs.version }}"
29+ if [ "${{ github.event_name }}" == "workflow_dispatch " ]; then
30+ echo "version= ${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT "
2731 else
2832 latest=$(git tag --list 'v*' --sort=-version:refname | head -n 1)
2933 if [ -z "$latest" ]; then
3539 patch=$(echo "$version" | cut -d. -f3)
3640 next="${major}.${minor}.$((patch + 1))"
3741 fi
42+ echo "version=${next}" >> "$GITHUB_OUTPUT"
3843 fi
39- echo "version=${next}" >> "$GITHUB_OUTPUT"
4044
4145 - name : Setup .NET
4246 uses : actions/setup-dotnet@v4
You can’t perform that action at this time.
0 commit comments