File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,12 +84,20 @@ jobs:
8484 uses : actions/setup-dotnet@v5.2.0
8585 with :
8686 dotnet-version : 9.0.x
87+ - name : Compute version suffix for branch builds
88+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
89+ id : version
90+ run : |
91+ # Sanitize branch name: lowercase, replace non-alphanumeric with hyphen, trim to 20 chars
92+ BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
93+ SAFE_BRANCH=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//' | sed 's/-$//' | cut -c1-20)
94+ echo "override=${SAFE_BRANCH}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
8795 - name : Download artifacts
8896 uses : actions/download-artifact@v8.0.1
8997 with :
9098 path : nuget.package/runtimes/
9199 - name : Create package
92- run : dotnet pack nuget.package
100+ run : dotnet pack nuget.package ${{ steps.version.outputs.override && format('/p:MinVerDefaultPreReleaseIdentifiers="{0}"', steps.version.outputs.override) || '' }}
93101 - name : Upload NuGet package
94102 uses : actions/upload-artifact@v7.0.0
95103 with :
You can’t perform that action at this time.
0 commit comments