Prepare v1.5.0 (#85) #23
Workflow file for this run
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
# ------------------------------------------------------------------------------ | |
# <auto-generated> | |
# | |
# This code was generated. | |
# | |
# - To turn off auto-generation set: | |
# | |
# [NugetPushGitHubActions (AutoGenerate = false)] | |
# | |
# - To trigger manual generation invoke: | |
# | |
# nuke --generate-configuration GitHubActions_release --host GitHubActions | |
# | |
# </auto-generated> | |
# ------------------------------------------------------------------------------ | |
name: release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
ubuntu-latest: | |
name: ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .Net 6.0.* | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.* | |
- name: Setup .Net 7.0.* | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.* | |
- name: Setup .Net 8.0.* | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.* | |
- name: Setup JDK (for SonarCloud) | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: Install/Update SonarCloud scanner | |
run: | |
dotnet tool update dotnet-sonarscanner --global | |
- name: Install/Update Coverlet Report Generator (for SonarCloud) | |
run: | |
dotnet tool update dotnet-reportgenerator-globaltool --global | |
- name: Setup Ruby v 3.1 (for docs generation with Jekyll) | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
- name: Begin SonarCloud scan | |
run: | |
dotnet-sonarscanner begin /k:"ebjornset_DryGen" /o:"ebjornset" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths="./.sonarqubecoverage/SonarQube.xml" | |
- name: 'Cache: .nuke/temp, ~/.nuget/packages' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.nuke/temp | |
~/.nuget/packages | |
key: ${{ runner.os }}-${{ hashFiles('global.json', 'src/**/*.csproj') }} | |
- name: 'Run: ' | |
run: ./build.cmd | |
- name: Generate docs with Jekyll | |
uses: limjh16/jekyll-action-ts@v2 | |
with: | |
enable_cache: true | |
jekyll_src: ./docs | |
- name: Check if there are any git changes | |
id: get_changes | |
run: echo "::set-output name=changed::$(git status --porcelain | wc -l)" | |
- name: List any git changes | |
if: steps.get_changes.outputs.changed != 0 | |
run: git status --porcelain | |
- name: Display any git diffs | |
if: steps.get_changes.outputs.changed != 0 | |
run: git diff HEAD | |
- name: Fail if there are any git changes | |
if: steps.get_changes.outputs.changed != 0 | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('Git modifications found after <nuke>. Maybe <nuke [docs]> was omitted before commit? Check the output from the step "Display any git diffs" and/or "List any git changes" for details about the detected git changes.') | |
- name: Run Coverlet Report Generator (for SonarCloud) | |
run: | |
reportgenerator "-reports:**/TestResults/**/coverage.cobertura.xml" "-targetdir:.sonarqubecoverage" "-reporttypes:SonarQube" | |
- name: End SonarCloud scan | |
run: | |
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run './build.cmd Push' | |
run: ./build.cmd Push | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
- name: Prepare generated docs for deployment on branch gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site | |
# If the Github Pages for the repository is configured correctly | |
# the gh-pages branch should be published automatically within a minute or so... | |
- name: Upload test results artifacts | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: TestResults | |
retention-days: 30 | |
path: '**/TestResults/**/*' |