Merge pull request #193 from JaCraig/dependabot/nuget/FastActivator.T… #262
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET Publish | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build: | |
env: | |
BUILD_CONFIG: 'Release' | |
SOLUTION: 'FastActivator.sln' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '8.0.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET SDK ${{ matrix.dotnet-version }} | |
uses: actions/[email protected] | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install Versionize | |
run: dotnet tool install --global Versionize | |
- name: Setup git | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "James Craig" | |
- name: Versionize Release | |
id: versionize | |
run: versionize --changelog-all --exit-insignificant-commits | |
continue-on-error: true | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration $BUILD_CONFIG | |
- name: Test | |
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=TestResults-${{ matrix.dotnet-version }}/ /p:CoverletOutputFormat=lcov /p:Configuration=$BUILD_CONFIG --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotnet-results-${{ matrix.dotnet-version }} | |
path: TestResults-${{ matrix.dotnet-version }} | |
if: ${{ always() }} | |
- name: Publish coverage report to coveralls.io | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
files: ./FastActivator.Tests/TestResults-${{ matrix.dotnet-version }}/coverage.net8.0.info | |
format: lcov | |
continue-on-error: true | |
- name: Upload NuGet package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NugetPackage | |
path: ./**/*.nupkg | |
if: steps.versionize.outcome == 'success' | |
- name: Upload Symbol package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SymbolPackage | |
path: ./**/*.snupkg | |
if: steps.versionize.outcome == 'success' | |
- name: Push changes to Github | |
if: steps.versionize.outcome == 'success' | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
branch: ${{ github.ref }} | |
force: true | |
tags: true | |
- name: Upload package to NuGet | |
if: steps.versionize.outcome == 'success' | |
run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |