Created
August 17, 2021 19:09
-
-
Save Andras-Csanyi/3a03e8b157197ec0fef60db5e7f7f367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- stage: Main_branch | |
condition: and(eq(variables['System.PullRequest.SourceBranch'], ''), eq(variables['Build.SourceBranch'],'refs/heads/main')) | |
jobs: | |
- job: sonar_scan | |
displayName: Sonar scan | |
steps: | |
- script: | | |
dotnet sonarscanner begin \ | |
/k:"Guards" \ | |
/d:sonar.host.url=$(sonar.host.url) \ | |
/d:sonar.login=$SONAR_LOGIN_NAME \ | |
/o:$(sonar.organization) \ | |
/s:../s/sonar.xml \ | |
/d:sonar.pullrequest.provider=GitHub \ | |
/d:sonar.pullrequest.github.repository=EncyclopediaGalactica/Guards | |
env: | |
SONAR_LOGIN_NAME: $(sonar.login) | |
- job: restore_solution | |
displayName: Restore solution | |
steps: | |
- script: dotnet restore $solutionName | |
- job: build_solution | |
dependsOn: restore_solution | |
displayName: Build solution | |
steps: | |
- script: dotnet build $solutionName $debugBuild | |
- job: test_solution | |
dependsOn: build_solution | |
displayName: Test solution | |
steps: | |
- script: dotnet test $solutionName | |
- job: sonar_end | |
dependsOn: test_solution | |
displayName: Sonar End | |
steps: | |
- script: | | |
dotnet sonarscanner end /d:sonar.login=$(sonar.login) | |
env: | |
SONAR_LOGIN_NAME: $(sonar.login) | |
- job: install_semantic | |
dependsOn: sonar_end | |
displayName: Install Semantic | |
steps: | |
- script: | | |
echo '##vso[task.prependpath]$(HOME)/.local/bin' | |
displayName: PATH | |
- script: | | |
npm install npm@6 | |
displayName: npm@6 | |
- script: | | |
npm install semantic-release | |
displayName: semantic-release | |
- script: | | |
npm install @semantic-release/changelog | |
displayName: semantic-release/changelog | |
- script: | | |
npm install @semantic-release/exec | |
displayName: semantic-release/exec | |
- script: | | |
npm install @semantic-release/git | |
displayName: semantic-release/git | |
- script: | | |
npm install @semantic-release/github | |
displayName: semantic-release/github | |
- script: | | |
pip3 install --user bump2version | |
displayName: bump2version | |
- job: semantic_release | |
dependsOn: install_semantic | |
displayName: Semantic Release | |
steps: | |
- script: | | |
echo '##vso[task.prependpath]$(HOME)/.local/bin' | |
displayName: PATH | |
- script: | | |
npx semantic-release | |
displayName: semantic-release | |
env: | |
GH_TOKEN: $(githubToken) | |
- job: nuget | |
dependsOn: semantic_release | |
displayName: Nuget | |
workspace: | |
clean: all | |
steps: | |
- script: | | |
dotnet pack Guards.csproj --configuration Release --include-symbols -p:NuspecFile=Guards.nuspec | |
displayName: Nuget | |
workingDirectory: src/Guards | |
- script: | | |
dotnet nuget push src/Guards/bin/Release/EncyclopediaGalactica.Guards.`cat version.txt`.nupkg --api-key $NUGET_TOKEN --source "https://nuget.pkg.github.com/EncyclopediaGalactica/index.json" --skip-duplicate | |
displayName: Publish Nuget | |
env: | |
GH_TOKEN: $(githubToken) | |
USERNAME: $(githubUserName) | |
NUGET_TOKEN: $(nugetToken) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment