1010 ["**.md", ".github/ISSUE_TEMPLATE/**", ".github/pull_request_template.md"]
1111 schedule :
1212 - cron : " 0 23 * * *" # Daily at 11 PM UTC
13+ workflow_dispatch : # Allow manual triggers
1314
1415concurrency :
1516 group : ${{ github.workflow }}-${{ github.ref }}
3435 version : ${{ steps.pipeline.outputs.version }}
3536 release_hash : ${{ steps.pipeline.outputs.release_hash }}
3637 should_release : ${{ steps.pipeline.outputs.should_release }}
38+ skipped_release : ${{ steps.pipeline.outputs.skipped_release }}
3739
3840 steps :
3941 - name : Set up JDK 17
@@ -58,34 +60,48 @@ jobs:
5860 cache : true
5961 cache-dependency-path : " **/*.csproj"
6062
63+ - name : Install dotnet-coverage
64+ shell : pwsh
65+ run : |
66+ dotnet tool install --global dotnet-coverage
67+
6168 - name : Cache SonarQube Cloud packages
69+ if : ${{ env.SONAR_TOKEN != '' }}
6270 uses : actions/cache@v4
71+ env :
72+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
6373 with :
6474 path : ~\sonar\cache
6575 key : ${{ runner.os }}-sonar
6676 restore-keys : ${{ runner.os }}-sonar
6777
6878 - name : Cache SonarQube Cloud scanner
79+ if : ${{ env.SONAR_TOKEN != '' }}
6980 id : cache-sonar-scanner
7081 uses : actions/cache@v4
82+ env :
83+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
7184 with :
7285 path : .\.sonar\scanner
7386 key : ${{ runner.os }}-sonar-scanner
7487 restore-keys : ${{ runner.os }}-sonar-scanner
7588
7689 - name : Install SonarQube Cloud scanner
77- if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
78- shell : powershell
90+ if : ${{ env.SONAR_TOKEN != '' && steps.cache-sonar-scanner.outputs.cache-hit != 'true' }}
91+ env :
92+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
93+ shell : pwsh
7994 run : |
8095 New-Item -Path .\.sonar\scanner -ItemType Directory
8196 dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
8297
8398 - name : Begin SonarQube
99+ if : ${{ env.SONAR_TOKEN != '' }}
84100 env :
85101 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
86- shell : powershell
102+ shell : pwsh
87103 run : |
88- .\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ github.repository_owner }}_${{ github.event.repository.name }}" /o:"${{ github.repository_owner }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=" coverage/coverage.opencover.xml" /d:sonar.coverage. exclusions="**/*Test*.cs,**/*.Tests.cs ,**/*.Tests /**/*,**/obj/**/*,**/*.dll" /d:sonar.cs.vstest .reportsPaths=" coverage/TestResults/**/*.trx" /d:sonar.verbose=true
104+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ github.repository_owner }}_${{ github.event.repository.name }}" /o:"${{ github.repository_owner }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverage. exclusions="**/*Tests/**/* ,**/*Test /**/*,**/obj/**/*,**/*.dll" /d:sonar.cs.vscoveragexml .reportsPaths=coverage.xml
89105
90106 - name : Run PSBuild Pipeline
91107 id : pipeline
@@ -105,6 +121,7 @@ jobs:
105121 -GitHubRepo "${{ github.repository }}" `
106122 -GithubToken "${{ github.token }}" `
107123 -NuGetApiKey "${{ secrets.NUGET_KEY }}" `
124+ -KtsuPackageKey "${{ secrets.KTSU_PACKAGE_KEY }}" `
108125 -WorkspacePath "${{ github.workspace }}" `
109126 -ExpectedOwner "ktsu-dev" `
110127 -ChangelogFile "CHANGELOG.md" `
@@ -130,16 +147,21 @@ jobs:
130147 "release_hash=$($buildConfig.Data.ReleaseHash)" >> $env:GITHUB_OUTPUT
131148 "should_release=$($buildConfig.Data.ShouldRelease)" >> $env:GITHUB_OUTPUT
132149
150+ if ($buildConfig.Data.SkippedRelease) {
151+ "skipped_release=true" >> $env:GITHUB_OUTPUT
152+ }
153+
133154 - name : End SonarQube
155+ if : env.SONAR_TOKEN != '' && steps.pipeline.outputs.skipped_release != 'true'
134156 env :
135157 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
136- shell : powershell
158+ shell : pwsh
137159 run : |
138160 .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
139161
140162 - name : Upload Coverage Report
141163 uses : actions/upload-artifact@v4
142- if : always()
164+ if : always() && steps.pipeline.outputs.skipped_release != 'true'
143165 with :
144166 name : coverage-report
145167 path : |
@@ -149,7 +171,7 @@ jobs:
149171 winget :
150172 name : Update Winget Manifests
151173 needs : build
152- if : needs.build.outputs.should_release == 'true'
174+ if : needs.build.outputs.should_release == 'true' && needs.build.outputs.skipped_release != 'true'
153175 runs-on : windows-latest
154176 timeout-minutes : 10
155177 permissions :
@@ -186,7 +208,7 @@ jobs:
186208 security :
187209 name : Security Scanning
188210 needs : build
189- if : needs.build.outputs.should_release == 'true'
211+ if : needs.build.outputs.should_release == 'true' && needs.build.outputs.skipped_release != 'true'
190212 runs-on : windows-latest
191213 timeout-minutes : 10
192214 permissions :
@@ -200,4 +222,4 @@ jobs:
200222 ref : ${{ needs.build.outputs.release_hash }}
201223
202224 - name : Detect Dependencies
203- uses : advanced-security/component-detection-dependency-submission-action@v0.0.2
225+ uses : advanced-security/component-detection-dependency-submission-action@v0.0.2
0 commit comments