Skip to content

Pinned major version for framework packages #1819

Pinned major version for framework packages

Pinned major version for framework packages #1819

Workflow file for this run

name: Build and run unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
- release
release:
types:
- published
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest] # [ubuntu-latest, windows-latest, macOS-latest]
configuration: [Release, Debug]
env:
IsReleaseBuild: ${{ matrix.configuration == 'Release' && github.event_name == 'release' && !github.event.release.prerelease && github.ref == 'refs/heads/master' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install .NET 8 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install .NET 9 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Install SF SDK
shell: powershell
run: |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -OutFile setup.exe -Uri https://download.microsoft.com/download/b/8/a/b8a2fb98-0ec1-41e5-be98-9d8b5abf7856/MicrosoftServiceFabric.10.1.2448.9590.exe
.\setup.exe /accepteula /force /quiet
- name: Build with dotnet
run: dotnet build --configuration ${{ matrix.configuration }}
- name: Run Unit Tests
run: dotnet test --no-build --configuration ${{ matrix.configuration }}
- name: Create NuGet packages
run: dotnet pack --no-build --configuration ${{ matrix.configuration }}
- name: Add GitHub package source
run: dotnet nuget add source https://nuget.pkg.github.com/microsoft/index.json --name "github" --username NotUsed --password ${{ secrets.GITHUB_TOKEN }}
- name: Publish NuGet packages
run: dotnet nuget push nuget\*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate --no-symbols true
if: matrix.configuration == 'Release' && github.event_name == 'release' && github.ref == 'refs/heads/master'