Skip to content

Upgrade TFM to net6, net7 & net8 #574

Upgrade TFM to net6, net7 & net8

Upgrade TFM to net6, net7 & net8 #574

Workflow file for this run

name: .NET Core CI/CD
on:
push:
branches:
- master
tags:
- v*
paths:
- '**'
- '!**.md'
pull_request:
paths:
- '**'
- '!**.md'
jobs:
build:
name: Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
configuration: [ Debug, Release ]
include:
- os: ubuntu-latest
configuration: Release
is-main: true
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
# COMPlus_EnableAVX: 0
# COMPlus_EnableSSE: 0
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/Cellar/[email protected]/
steps:
- uses: actions/checkout@v4
# - name: Setup OpenSSL (macOS)
# if: matrix.os == 'macos-latest'
# run: |
# ln -s /usr/local/opt/[email protected]/lib/libssl.1.1.dylib /usr/local/lib/libssl.1.1.dylib
# ln -s /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.1.1.dylib
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore
- name: Test
# disable macOS tests
# if: matrix.os != 'macos-latest'
run: dotnet test -c ${{ matrix.configuration }} --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory "TestResults"
- name: Upload dotnet test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.configuration }}-${{ matrix.os }}
path: TestResults
- name: Upload coverage to Codecov
if: matrix.is-main
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Creates NuGet packages
if: matrix.is-main
run: dotnet pack -c ${{ matrix.configuration }} --output=nuget_packed --no-build
- name: Upload NuGet packages to Artifacts
if: matrix.is-main
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: |
nuget_packed/*.nupkg
nuget_packed/*.snupkg
publish:
name: Publish packages
if: contains(github.ref, 'tags/v')
needs: [build]
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Download generated NuGet packages
uses: actions/download-artifact@v4
with:
name: nuget-packages
- name: Push packages to api.nuget.org
run: dotnet nuget push **/*.nupkg --api-key=${{ secrets.NUGET_APIKEY }} --source=https://api.nuget.org/v3/index.json --skip-duplicate