33 pull_request :
44 types : [opened, reopened, edited, synchronize]
55 paths-ignore :
6+ - " **/*.md"
67 - " **/*.gitignore"
78 - " **/*.gitattributes"
8- branches :
9- - master
10- - develop/**
11- - pre-release/**
12- - release/**
13- push :
14- branches :
15- - pre-release/**
16- - pre-release
17- - release/**
18- - release
199
2010jobs :
2111 Run-Lint :
5545 uses : actions/checkout@v4
5646 with :
5747 fetch-depth : 0
58- ref : ${{ github.event.pull_request.head.sha || github.ref }}
48+ ref : ${{ github.event.pull_request.head.sha }}
5949
6050 - name : Step-03 Calculate Version
6151 id : gitversion
6858 echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}"
6959 echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
7060 echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}"
71- echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}"
7261
7362 - name : Step-05 Install .NET
7463 uses : actions/setup-dotnet@v3
7968 run : dotnet restore
8069 working-directory : ' ${{ env.working-directory }}'
8170
82- - name : Step-07 Build Version (Pre-release Alpha)
83- if : ${{ startsWith(github.head_ref, 'pre-release/') || startsWith(github.ref, 'refs/heads/pre-release/') }}
84- run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
85- working-directory : ' ${{ env.working-directory }}'
86-
87- - name : Step-07 Build Version (Release)
88- if : ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }}
89- run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
90- working-directory : ' ${{ env.working-directory }}'
91-
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/')) }}
71+ - name : Step-07 Build Version (Beta)
9472 run : dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
9573 working-directory : ' ${{ env.working-directory }}'
9674
@@ -103,43 +81,4 @@ jobs:
10381 with :
10482 name : build-artifact
10583 path : ${{ env.working-directory }}
106- retention-days : 1
107-
108- Package :
109- needs : [Build-Test]
110- runs-on : ubuntu-latest
111- env :
112- github-token : ' ${{ secrets.GH_Packages }}'
113- nuget-token : ' ${{ secrets.NUGET_API_KEY }}'
114- working-directory : ${{ github.workspace }}
115- steps :
116- - name : Step-01 Retrieve Build Artifacts
117- uses : actions/download-artifact@v4
118- with :
119- name : build-artifact
120- path : ${{ env.working-directory }}
121-
122- - name : Step-02 Install Github Packages
123- run : dotnet tool install gpr --global
124-
125- - name : Step-03 Publish to Github Packages
126- run : find . -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \;
127-
128- Release :
129- name : Release to Nuget
130- needs : [Package]
131- if : ${{ startsWith(github.head_ref, 'release/') || startsWith(github.ref, 'refs/heads/release/') }}
132- runs-on : ubuntu-latest
133- env :
134- nuget-token : ' ${{ secrets.NUGET_API_KEY }}'
135- working-directory : ${{ github.workspace }}
136- steps :
137- - name : Step-01 Retrieve Build Artifacts
138- uses : actions/download-artifact@v4
139- with :
140- name : build-artifact
141- path : ${{ env.working-directory }}
142-
143- - name : Step-02 Release to Nuget Org
144- run : |
145- find ${{ env.working-directory }}/src -name "*.nupkg" -path "*/Release/*.nupkg" -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \;
84+ retention-days : 1
0 commit comments