File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 tags :
66 - ' [0-9]+.[0-9]+.[0-9]+'
7+ branches :
8+ - ' release/[0-9]+.[0-9]+.[0-9]+'
79
810jobs :
911 publish :
@@ -19,23 +21,32 @@ jobs:
1921 with :
2022 dotnet-version : ' 10.x'
2123
24+ - name : Determine version
25+ id : version
26+ run : |
27+ if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
28+ echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
29+ elif [[ "${GITHUB_REF}" == refs/heads/release/* ]]; then
30+ SEMVER="${GITHUB_REF_NAME#release/}"
31+ RC_NUMBER="${GITHUB_RUN_NUMBER}"
32+ echo "version=${SEMVER}-rc.${RC_NUMBER}" >> "$GITHUB_OUTPUT"
33+ fi
34+
2235 - name : Restore dependencies
2336 run : dotnet restore
2437
2538 - name : Build with explicit version
2639 run : |
27- VERSION=${GITHUB_REF_NAME}
2840 dotnet build \
2941 --configuration Release \
30- -p:Version=$VERSION \
42+ -p:Version=${{ steps.version.outputs.version }} \
3143 --no-restore
3244
3345 - name : Pack with symbols
3446 run : |
35- VERSION=${GITHUB_REF_NAME}
3647 dotnet pack \
3748 --configuration Release \
38- -p:Version=$VERSION \
49+ -p:Version=${{ steps.version.outputs.version }} \
3950 -p:IncludeSymbols=true \
4051 -p:SymbolPackageFormat=snupkg \
4152 --no-build \
You can’t perform that action at this time.
0 commit comments