44 push :
55 branches :
66 - main
7- tags : ['v*', ' !v*-*' ]
7+ tags : ["v*", " !v*-*" ]
88
99 workflow_dispatch :
1010 inputs :
1111 reason :
12- description : ' Why run?'
12+ description : " Why run?"
13+
14+ os :
15+ description : " JSON array of runners"
16+ type : string
17+ default : ' ["ubuntu-latest"]'
18+ required : true
19+
1320 dotnet-version :
14- description : ' Version of .NET SDK to use'
15- default : ' 9.0.x'
21+ description : " Version of .NET SDK to use"
22+ type : string
23+ default : " 9.0.x"
24+ required : true
25+
26+ test-project :
27+ description : " Path to test project"
28+ type : string
29+ default : " ./test/UlidType.Tests/UlidType.Tests.csproj"
30+ required : true
31+
32+ benchmark-project :
33+ description : " Path to benchmark project"
34+ type : string
35+ default : " ./benchmarks/UlidType.Benchmarks/UlidType.Benchmarks.csproj"
36+ required : true
1637
1738env :
39+ CI : true
1840 NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
1941 REASON : ${{ inputs.reason || 'manual run' }}
2042
2143jobs :
44+ # last time run the gates before release
45+ build :
46+ name : Build
47+ uses : ./.github/workflows/build.yml
48+ with :
49+ os : ${{ inputs.os || vars.MATRIX_OS || '["ubuntu-latest"]' }}
50+ dotnet-version : ${{ inputs.dotnet-version || vars.DOTNET_VERSION || '9.0.x' }}
51+ configuration : Release
52+
53+ test :
54+ name : Test
55+ needs : build
56+ uses : ./.github/workflows/test.yml
57+ with :
58+ os : ${{ inputs.os || vars.MATRIX_OS || '["ubuntu-latest"]' }}
59+ dotnet-version : ${{ inputs.dotnet-version || vars.DOTNET_VERSION || '9.0.x' }}
60+ test-project : ${{ inputs.test-project || vars.TEST_PROJECT || './test/UlidType.Tests/UlidType.Tests.csproj' }}
61+ configuration : Release
62+ verbose : ${{ fromJSON(vars.VERBOSE) || false }}
63+ min-coverage-pct : ${{ fromJSON(vars.MIN_COVERAGE_PCT) || 75 }}
64+
65+ benchmarks :
66+ name : Benchmarks (Linux only)
67+ needs : build
68+ uses : ./.github/workflows/benchmarks.yml
69+ with :
70+ os : ${{ inputs.os || vars.MATRIX_OS || '["ubuntu-latest"]' }}
71+ dotnet-version : ${{ inputs.dotnet-version || vars.DOTNET_VERSION || '9.0.x' }}
72+ benchmark-project : ${{ inputs.benchmark-project || vars.BENCHMARK_PROJECT || './benchmarks/UlidType.Benchmarks/UlidType.Benchmarks.csproj' }}
73+ configuration : Release
74+ verbose : ${{ fromJSON(vars.VERBOSE) || false }}
75+ max-regression-pct : ${{ fromJSON(vars.MAX_REGRESSION_PCT) || 10 }}
76+
2277 release :
2378 if : ${{ github.event_name == 'workflow_dispatch' || (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name,'-')) }}
2479 runs-on : ubuntu-latest
@@ -39,35 +94,32 @@ jobs:
3994 **/packages.lock.json
4095 **/*.csproj
4196
42- - name : Test
43- run : dotnet test -c Release
44-
4597 - name : Pack (stable)
4698 env :
4799 REASON : ${{ inputs.reason }}
48100 run : |
49101 mkdir -p artifacts/pack
50- dotnet pack -c Release --no-build - o artifacts/pack \
102+ dotnet pack -c Release -o artifacts/pack \
51103 "/p:PackageReleaseNotes=Stable: ${REASON:-tag push}"
52104 ls -1 artifacts/pack
53105
54106 - name : Publish stable to NuGet
55107 env :
56108 NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
57109 run : |
58- if [ -z "${NUGET_API_KEY}" ]; then
59- echo "NUGET_API_KEY not configured"; exit 1
60- fi
110+ if [ -z "${NUGET_API_KEY}" ]; then
111+ echo "NUGET_API_KEY not configured"; exit 1
112+ fi
61113
62- dotnet nuget push artifacts/pack/*.nupkg \
63- --api-key "${NUGET_API_KEY}" \
64- --source https://api.nuget.org/v3/index.json \
65- --skip-duplicate
114+ dotnet nuget push artifacts/pack/*.nupkg \
115+ --api-key "${NUGET_API_KEY}" \
116+ --source https://api.nuget.org/v3/index.json \
117+ --skip-duplicate
66118
67- dotnet nuget push artifacts/pack/*.snupkg \
68- --api-key "${NUGET_API_KEY}" \
69- --source https://api.nuget.org/v3/index.json \
70- --skip-duplicate
119+ dotnet nuget push artifacts/pack/*.snupkg \
120+ --api-key "${NUGET_API_KEY}" \
121+ --source https://api.nuget.org/v3/index.json \
122+ --skip-duplicate
71123
72124 - name : Summary
73125 env :
80132 echo "- Stable release reason: ${REASON:-tag push}"
81133 echo "- Artifacts:"
82134 ls -1 artifacts/pack | sed 's/^/ - /'
83- } >> "$GITHUB_STEP_SUMMARY"
135+ } >> "$GITHUB_STEP_SUMMARY"
0 commit comments