Bump xunit.runner.visualstudio from 2.8.0 to 2.8.2 #408
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: CI | |
on: | |
# Trigger the workflow on push or pull request, | |
# for any branch or version tag | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0.10.2 | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/execute@v0.10.2 | |
with: | |
useConfigFile: true | |
configFilePath: ./GitVersion.yml | |
- name: Update project version | |
uses: roryprimrose/set-vs-sdk-project-version@v1.0.6 | |
with: | |
version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} | |
assemblyVersion: ${{ steps.gitversion.outputs.AssemblySemVer }} | |
fileVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }} | |
informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }} | |
- name: Setup dotnet v8.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x' # SDK Version to use. | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Test | |
run: dotnet test -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura | |
- name: Generate coverage report | |
# run: reportgenerator -reports:**/coverage.cobertura.xml -targetdir:Report -reporttypes:HtmlInline_AzurePipelines;Cobertura | |
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.5 | |
with: | |
reports: "**/coverage*cobertura.xml" | |
targetdir: "Report" | |
reporttypes: "HtmlInline;Cobertura" | |
tag: '${{ github.run_number }}_${{ github.run_id }}' | |
if: github.event_name == 'pull_request' && github.repository_owner == 'roryprimrose' # Don't run on forks | |
- name: Publish coverage report | |
uses: 5monkeys/cobertura-action@master | |
with: | |
path: Report/Cobertura.xml | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
minimum_coverage: 75 | |
if: github.event_name == 'pull_request' && github.repository_owner == 'roryprimrose' # Don't run on forks | |
- name: Resolve project name | |
shell: pwsh | |
run: Add-Content -Path ${env:GITHUB_ENV} "`nprojectName=$(${env:GITHUB_REPOSITORY}.substring(${env:GITHUB_REPOSITORY}.IndexOf('/') + 1))" -Encoding utf8 | |
- name: Pack | |
run: | | |
dotnet pack "./${{ env.projectName }}/${{ env.projectName }}.csproj" -c Release --no-build --include-symbols -o $GITHUB_WORKSPACE/staging | |
dotnet pack "./${{ env.projectName }}.NSubstitute/${{ env.projectName }}.NSubstitute.csproj" -c Release --no-build --include-symbols -o $GITHUB_WORKSPACE/staging | |
- name: Publish build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: staging | |
- shell: bash | |
name: Write version | |
run: | | |
echo '${{ steps.gitversion.outputs.NuGetVersionV2 }}' > version.txt | |
- name: Upload version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: version | |
path: version.txt | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'roryprimrose' # Don't run on forks | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
- name: Setup nuget | |
uses: nuget/setup-nuget@v2 | |
# Temporary steps while waiting for nuget client to support multiple package push | |
- name: Download version | |
uses: actions/download-artifact@v4 | |
with: | |
name: version | |
- name: Read version | |
shell: bash | |
run: | | |
value=`cat version.txt` | |
echo NuGetVersionV2=$(echo $value) >> $GITHUB_ENV | |
- name: Publish to MyGet.org | |
env: | |
MYGET_APIKEY: ${{ secrets.MYGET_APIKEY }} | |
run: | | |
nuget push Neovolve.Streamline.${{ env.NuGetVersionV2 }}.symbols.nupkg $MYGET_APIKEY -source https://www.myget.org/F/neovolve/api/v2/package | |
nuget push Neovolve.Streamline.NSubstitute.${{ env.NuGetVersionV2 }}.symbols.nupkg $MYGET_APIKEY -source https://www.myget.org/F/neovolve/api/v2/package | |
continue-on-error: true # just in case MyGet is down | |
# End temporary steps | |
# - name: Publish to MyGet.org | |
# env: | |
# MYGET_APIKEY: ${{ secrets.MYGET_APIKEY }} | |
# run: nuget push *.*.symbols.nupkg $MYGET_APIKEY -source https://www.myget.org/F/neovolve/api/v2/package | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'roryprimrose' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
- name: Download version | |
uses: actions/download-artifact@v4 | |
with: | |
name: version | |
- name: Read version | |
shell: bash | |
run: | | |
value=`cat version.txt` | |
echo NuGetVersionV2=$(echo $value) >> $GITHUB_ENV | |
- name: Resolve project name | |
shell: pwsh | |
run: Add-Content -Path ${env:GITHUB_ENV} "`nprojectName=$(${env:GITHUB_REPOSITORY}.substring(${env:GITHUB_REPOSITORY}.IndexOf('/') + 1))" -Encoding utf8 | |
- name: Setup nuget | |
uses: nuget/setup-nuget@v1 | |
# Temporary steps while waiting for nuget client to support multiple package push | |
# - name: Publish to GitHub | |
# env: | |
# GPR_APIKEY: ${{ secrets.GPR_APIKEY }} | |
# run: | | |
# nuget push Neovolve.Streamline.${{ env.NuGetVersionV2 }}.symbols.nupkg $GPR_APIKEY -source https://nuget.pkg.github.com/roryprimrose/index.json | |
# nuget push Neovolve.Streamline.NSubstitute.${{ env.NuGetVersionV2 }}.symbols.nupkg $GPR_APIKEY -source https://nuget.pkg.github.com/roryprimrose/index.json | |
- name: Publish to NuGet.org | |
env: | |
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} | |
run: | | |
nuget push Neovolve.Streamline.${{ env.NuGetVersionV2 }}.symbols.nupkg $NUGET_APIKEY -source https://api.nuget.org/v3/index.json | |
nuget push Neovolve.Streamline.NSubstitute.${{ env.NuGetVersionV2 }}.symbols.nupkg $NUGET_APIKEY -source https://api.nuget.org/v3/index.json | |
# End temporary steps | |
# - name: Publish to GitHub | |
# env: | |
# GPR_APIKEY: ${{ secrets.GPR_APIKEY }} | |
# run: nuget push *.*.symbols.nupkg $GPR_APIKEY -source https://nuget.pkg.github.com/roryprimrose/index.json | |
# | |
# - name: Publish to NuGet.org | |
# env: | |
# NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} | |
# run: nuget push *.*.symbols.nupkg $NUGET_APIKEY -source https://api.nuget.org/v3/index.json | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.NuGetVersionV2 }} | |
release_name: Release ${{ env.NuGetVersionV2 }} | |
draft: false | |
prerelease: ${{ contains(env.NuGetVersionV2, 'beta') }} | |
- name: Upload release asset for package | |
id: upload-release-asset-package | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.projectName }}.${{ env.NuGetVersionV2 }}.nupkg | |
asset_name: ${{ env.projectName }}.${{ env.NuGetVersionV2 }}.nupkg | |
asset_content_type: application/zip | |
- name: Upload release asset for symbol package | |
id: upload-release-asset-symbolpackage | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.projectName }}.${{ env.NuGetVersionV2 }}.symbols.nupkg | |
asset_name: ${{ env.projectName }}.${{ env.NuGetVersionV2 }}.symbols.nupkg | |
asset_content_type: application/zip |