1010 - develop/**
1111 - pre-release/**
1212 - release/**
13+ push :
14+ branches :
15+ - pre-release/**
16+ - pre-release
17+ - release/**
18+ - release
19+
1320jobs :
1421 Run-Lint :
1522 runs-on : ubuntu-latest
2734 FILTER_REGEX_INCLUDE : .*src/.*
2835 DEFAULT_BRANCH : master
2936 GITHUB_TOKEN : ' ${{ env.github-token }}'
37+
3038 Build-Test :
3139 runs-on : ubuntu-latest
3240 outputs :
4755 uses : actions/checkout@v4
4856 with :
4957 fetch-depth : 0
50- ref : ${{ github.event.pull_request.head.sha }}
58+ ref : ${{ github.event.pull_request.head.sha || github.ref }}
5159
5260 - name : Step-03 Calculate Version
5361 id : gitversion
@@ -71,16 +79,21 @@ jobs:
7179 run : dotnet restore
7280 working-directory : ' ${{ env.working-directory }}'
7381
74- - name : Step-07 Build Version (Beta )
75- if : ${{ ! startsWith(github.head_ref, 'release/') }}
82+ - name : Step-07 Build Version (Pre-release Alpha )
83+ if : ${{ startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre- release/') }}
7684 run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
7785 working-directory : ' ${{ env.working-directory }}'
7886
7987 - name : Step-07 Build Version (Release)
80- if : ${{ startsWith(github.head_ref, 'release/') }}
88+ if : ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }}
8189 run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
8290 working-directory : ' ${{ env.working-directory }}'
8391
92+ - name : Step-07 Build Version (Beta/Other)
93+ if : ${{ !(startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') || startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/')) }}
94+ run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
95+ working-directory : ' ${{ env.working-directory }}'
96+
8497 - name : Step-08 Test Solution
8598 run : dotnet test --configuration Release --no-build --no-restore --verbosity normal
8699 working-directory : ' ${{ env.working-directory }}'
@@ -115,7 +128,7 @@ jobs:
115128 Release :
116129 name : Release to Nuget
117130 needs : [Package]
118- if : ${{ startsWith(github.head_ref, 'release/') }}
131+ if : ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }}
119132 runs-on : ubuntu-latest
120133 env :
121134 nuget-token : ' ${{ secrets.NUGET_API_KEY }}'
0 commit comments