Bump xunit.runner.visualstudio from 2.5.0 to 2.5.1 in /src #518
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
name: Build | |
on: | |
push: | |
tags: v[1-9]+.[0-9]+.[0-9]+ | |
branches: [ master ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Cache nuget packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.nuget/packages | |
key: nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
nuget- | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Check GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Echo version | |
run: echo ${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
- name: Test | |
run: dotnet test src --configuration Release --nologo --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | |
- name: Build | |
shell: powershell | |
run: dotnet build src --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
- name: InspectCodeAnalysis | |
run: | | |
nuget install JetBrains.ReSharper.CommandLineTools -ExcludeVersion -OutputDirectory tools | |
./tools/JetBrains.ReSharper.CommandLineTools/tools/inspectcode -o="inspectcodereport.xml" --project="NVika" "src\Vika.sln" --toolset=14.0 | |
- name: GendarmeAnalysis | |
run: | | |
nuget install mono.gendarme -ExcludeVersion -OutputDirectory tools | |
./tools/Mono.Gendarme/tools/gendarme.exe --xml GendarmeReport.xml --ignore gendarme.ignore .\src\NVika\bin\Release\net6.0\NVika.exe | |
- name: LaunchNVika | |
run: .\src\NVika\bin\Release\net6.0\NVika.exe --debug --includesource inspectcodereport.xml ./src/NVika/bin/Release/net6.0/static-analysis.sarif.json GendarmeReport.xml | |
# - name: Create release notes | |
# run: | | |
# dotnet SemanticReleaseNotesParser -g=categories --debug -o="artifacts/ReleaseNotes.html" --pluralizecategoriestitle --includestyle | |
# dotnet SemanticReleaseNotesParser -g=categories --debug -t=environment -f=markdown --pluralizecategoriestitle | |
- name: Create MSBuild package | |
run: | | |
Copy-Item -Path resources/icon.png -Destination src\NVika.MSBuild\ | |
mkdir src\NVika.MSBuild\tools\ | |
Copy-Item -Path "src/NVika/bin/Release/net6.0/publish/*" -Destination src\NVika.MSBuild\tools\ | |
nuget pack src/NVika.MSBuild/NVika.MSBuild.nuspec -Version ${{ steps.gitversion.outputs.nuGetVersionV2 }} -OutputDirectory artifacts/nuget | |
- name: Create netcore packages | |
run: | | |
mkdir ./artifacts/zips | |
Compress-Archive -Path src/NVika/bin/Release/net6.0/publish/* -DestinationPath "artifacts/zips/NVika.netcore.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" | |
Copy-Item -Path "src/NVika/bin/Release/NVika.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg" -Destination artifacts/nuget | |
- name: Create windows version | |
run: | | |
dotnet publish src/NVika --configuration Release --output ./publish --self-contained true --runtime win-x86 -p:PublishSingleFile=true -p:PublishTrimmed=true /p:PackAsTool=false /p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
# Copy-Item -Path "artifacts/ReleaseNotes.html" -Destination publish | |
Compress-Archive -Path publish/* -DestinationPath "artifacts/zips/NVika.win-x86.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip" | |
- name: Create chocolatey version | |
run: | | |
mkdir ./artifacts/chocolatey | |
$installPath = "chocolatey/tools/chocolateyInstall.ps1" | |
$originalContent = Get-Content $installPath | |
$originalContent.replace('[version]', "${{ steps.gitversion.outputs.nuGetVersionV2 }}") | Set-Content $installPath | |
choco pack chocolatey/nvika.nuspec --version ${{ steps.gitversion.outputs.nuGetVersionV2 }} --outdir artifacts/chocolatey | |
Set-Content $installPath $originalContent | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: artifacts/* | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build] | |
runs-on: windows-latest | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- uses: actions/download-artifact@v2 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Get the version | |
id: get_version | |
run: | | |
$version = $env:GITHUB_REF.Replace('refs/tags/v', '') | |
echo "::set-output name=VERSION::$version" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: ${{ env.SemanticReleaseNotes }} | |
draft: false | |
prerelease: false | |
- name: Upload Zip netcore | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifact/zips/NVika.netcore.${{ steps.get_version.outputs.version }}.zip | |
asset_name: NVika.netcore.${{ steps.get_version.outputs.version }}.zip | |
asset_content_type: application/zip | |
- name: Upload Zip win-x86 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifact/zips/NVika.win-x86.${{ steps.get_version.outputs.version }}.zip | |
asset_name: NVika.win-x86.${{ steps.get_version.outputs.version }}.zip | |
asset_content_type: application/zip | |
- name: Chocolatey push | |
run: choco push artifact/chocolatey/nvika.${{ steps.get_version.outputs.version }}.nupkg --source=https://push.chocolatey.org/ --api-key=$env:CHOCO_API_KEY | |
env: | |
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} | |
- name: Nuget push Tool | |
run: dotnet nuget push artifact/nuget/NVika.${{ steps.get_version.outputs.version }}.nupkg -s https://api.nuget.org/v3/index.json -k $env:NUGET_API_KEY | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
- name: Nuget push MSBuild | |
run: dotnet nuget push artifact/nuget/NVika.MSBuild.${{ steps.get_version.outputs.version }}.nupkg -s https://api.nuget.org/v3/index.json -k $env:NUGET_API_KEY | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |