Skip to content

Publish EasyPersistence.EFCore to NuGet #12

Publish EasyPersistence.EFCore to NuGet

Publish EasyPersistence.EFCore to NuGet #12

name: Publish EasyPersistence.EFCore to NuGet
on:
workflow_dispatch:
jobs:
build-sign-pack-publish:
runs-on: windows-latest # 👈 Use Windows for .NET Framework & SqlServer.Server compatibility
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET 9 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
# verify installed SDKs
- name: Show installed .NET SDKs
run: dotnet --list-sdks
- name: Restore EFCore dependencies
run: dotnet restore src/EFCore/EFCore.csproj
- name: Restore EfCoreSqlClr dependencies
run: dotnet restore src/EfCoreSqlClr/EfCoreSqlClr.csproj
- name: Build EfCoreSqlClr (net48)
run: dotnet build src/EfCoreSqlClr/EfCoreSqlClr.csproj --configuration Release --no-restore
- name: Build EFCore (net9.0) with SQL CLR included
run: dotnet build src/EFCore/EFCore.csproj --configuration Release --no-restore
- name: Pack EFCore (embed EfCoreSqlClr.dll)
run: |
dotnet pack src/EFCore/EFCore.csproj `
--configuration Release `
--no-build `
--output ${{ github.workspace }}/artifacts `
-p:SuppressDependenciesWhenPacking=true
- name: List final package outputs
run: |
echo "Working directory: $PWD"
dir
dir artifacts
- name: Publish NuGet packages
shell: pwsh
run: |
Get-ChildItem -Path "${{ github.workspace }}/artifacts" -Filter *.nupkg | ForEach-Object {
dotnet nuget push $_.FullName --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate
}
- name: Publish symbols packages
shell: pwsh
run: |
Get-ChildItem -Path "${{ github.workspace }}/artifacts" -Filter *.snupkg | ForEach-Object {
dotnet nuget push $_.FullName --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json --skip-duplicate
}