66 - " **/*.md"
77 - " **/*.gitignore"
88 - " **/*.gitattributes"
9+
910jobs :
1011 Run-Lint :
1112 runs-on : ubuntu-latest
1213 env :
1314 github-token : ' ${{ secrets.GH_Packages }}'
1415 steps :
1516 - name : Step-01 Checkout code
16- uses : actions/checkout@v3
17+ uses : actions/checkout@v4
1718 with :
1819 fetch-depth : 0
1920 - name : Step-02 Lint Code Base
@@ -23,99 +24,61 @@ jobs:
2324 FILTER_REGEX_INCLUDE : .*src/.*
2425 DEFAULT_BRANCH : master
2526 GITHUB_TOKEN : ' ${{ env.github-token }}'
27+
2628 Build-Test :
2729 runs-on : ubuntu-latest
2830 outputs :
29- release_Version : ${{ steps.gitversion.outputs.MajorMinorPatch }}
30- beta_Version : ${{ steps.gitversion.outputs.nuGetVersion }}
31- branchName : ${{ steps.gitversion.outputs.branchName }}
31+ nuGetVersion : ${{ steps.gitversion.outputs.NuGetVersion }}
32+ majorMinorPatch : ${{ steps.gitversion.outputs.MajorMinorPatch }}
33+ fullSemVer : ${{ steps.gitversion.outputs.FullSemVer }}
34+ branchName : ${{ steps.gitversion.outputs.BranchName }}
3235 env :
33- working-directory : /home/runner/work/sourceflow.net/sourceflow.net
36+ working-directory : ${{ github.workspace }}
3437
3538 steps :
3639 - name : Step-01 Install GitVersion
37- uses : gittools/actions/gitversion/setup@v0.9.7
40+ uses : gittools/actions/gitversion/setup@v0.9.15
3841 with :
3942 versionSpec : 5.x
4043
4144 - name : Step-02 Check out Code
4245 uses : actions/checkout@v4
4346 with :
4447 fetch-depth : 0
48+ ref : ${{ github.event.pull_request.head.sha }}
4549
4650 - name : Step-03 Calculate Version
4751 id : gitversion
48- uses : gittools/actions/gitversion/execute@v0.9.7
52+ uses : gittools/actions/gitversion/execute@v0.9.15
4953 with :
5054 useConfigFile : true
5155
52- - name : Step-04 Install .NET
56+ - name : Step-04 Display Version Info
57+ run : |
58+ echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}"
59+ echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
60+ echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}"
61+
62+ - name : Step-05 Install .NET
5363 uses : actions/setup-dotnet@v3
5464 with :
5565 dotnet-version : 9.0.x
5666
57- - name : Step-05 Restore dependencies
67+ - name : Step-06 Restore dependencies
5868 run : dotnet restore
5969 working-directory : ' ${{ env.working-directory }}'
6070
61- - name : Step-06 Build Version (Beta)
62- if : ${{ !startsWith(github.head_ref, 'release/')}}
63- run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
64- working-directory : ' ${{ env.working-directory }}'
65-
66- - name : Step-06 Build Version (Release)
67- if : ${{ startsWith(github.head_ref, 'release/')}}
68- run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
71+ - name : Step-07 Build Version (Beta)
72+ run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
6973 working-directory : ' ${{ env.working-directory }}'
7074
71- - name : Step-07 Test Solution
72- run : dotnet test --configuration Release --no-build --no-restore --verbosity normal
75+ - name : Step-08 Test Solution
76+ run : dotnet test --configuration Release --no-build --no-restore --verbosity normal
7377 working-directory : ' ${{ env.working-directory }}'
7478
75- - name : Step-08 Upload Build Artifacts
79+ - name : Step-09 Upload Build Artifacts
7680 uses : actions/upload-artifact@v4
7781 with :
7882 name : build-artifact
79- path : ${{env.working-directory}}
80- retention-days : 1
81-
82- Package :
83- needs : [Build-Test]
84- runs-on : ubuntu-latest
85- outputs :
86- semVersion : ${{ needs.Build-Release.outputs.semVersion }}
87- env :
88- github-token : ' ${{ secrets.GH_Packages }}'
89- nuget-token : ' ${{ secrets.NUGET_API_KEY }}'
90- working-directory : /home/runner/work/sourceflow.net/sourceflow.net
91- steps :
92- - name : Step-01 Retrieve Build Artifacts
93- uses : actions/download-artifact@v4
94- with :
95- name : build-artifact
96- path : ${{env.working-directory}}
97-
98- - name : Step-02 Install Github Packages
99- run : dotnet tool install gpr --global
100-
101- - name : Step-03 Publish to Github Packages
102- run : find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;
103-
104- Release :
105- name : Release to Nuget
106- needs : [Package]
107- if : ${{ startsWith(github.head_ref, 'release/')}}
108- runs-on : ubuntu-latest
109- env :
110- nuget-token : ' ${{ secrets.NUGET_API_KEY }}'
111- working-directory : /home/runner/work/sourceflow.net/sourceflow.net
112- steps :
113- - name : Step-01 Retrieve Build Artifacts
114- uses : actions/download-artifact@v4
115- with :
116- name : build-artifact
117- path : ${{env.working-directory}}
118- - name : Step-03 Release to Nuget Org
119- if : ${{ startsWith(github.head_ref, 'release/')}}
120- run : dotnet nuget push ${{env.working-directory}}/src/parsley/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
121-
83+ path : ${{ env.working-directory }}
84+ retention-days : 1
0 commit comments