Skip to content

Upgrade TFM to net6, net7 & net8 #555

Upgrade TFM to net6, net7 & net8

Upgrade TFM to net6, net7 & net8 #555

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
- os: windows-latest
configuration: Release
is-netfx: 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@v2
# - 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 '2.2.x'
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '2.2.x'
# - name: Setup dotnet '3.1.x'
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
# - name: Setup dotnet '5.x'
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '5.0.x'
- name: Setup dotnet '6.x'
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Setup dotnet '7.x'
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
- name: Setup dotnet '8.x'
uses: actions/setup-dotnet@v1
with:
dotnet-version: '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
- name: Upload coverage to Codecov
if: matrix.is-netfx
uses: codecov/codecov-action@v1
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@v2
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@v2
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