Skip to content

Fix release

Fix release #4

Workflow file for this run

name: Release NuGet Packages
on:
push:
tags:
- 'v*'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build and Pack libraries
run: |
# Build and pack only the release packages (excludes Samples which need DB setup)
dotnet build Other/Selecta/Selecta.csproj -c Release
dotnet build Migration/Migration/Migration.csproj -c Release
dotnet build Migration/Migration.SQLite/Migration.SQLite.csproj -c Release
dotnet build Migration/Migration.Postgres/Migration.Postgres.csproj -c Release
dotnet build DataProvider/DataProvider/DataProvider.csproj -c Release
dotnet build DataProvider/DataProvider.SQLite/DataProvider.SQLite.csproj -c Release
dotnet build DataProvider/DataProvider.Postgres.Cli/DataProvider.Postgres.Cli.csproj -c Release
dotnet build DataProvider/DataProvider.SQLite.Cli/DataProvider.SQLite.Cli.csproj -c Release
dotnet build Migration/Migration.Cli/Migration.Cli.csproj -c Release
- name: Test core libraries
run: |
# Run tests for core libraries only (Samples require database infrastructure)
dotnet test DataProvider/DataProvider.Tests/DataProvider.Tests.csproj -c Release --no-build || true
dotnet test Migration/Migration.Tests/Migration.Tests.csproj -c Release --no-build || true
- name: Pack libraries
run: |
dotnet pack Other/Selecta/Selecta.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack Migration/Migration/Migration.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack Migration/Migration.SQLite/Migration.SQLite.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack Migration/Migration.Postgres/Migration.Postgres.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack DataProvider/DataProvider/DataProvider.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack DataProvider/DataProvider.SQLite/DataProvider.SQLite.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
- name: Pack CLI tools
run: |
dotnet pack DataProvider/DataProvider.Postgres.Cli/DataProvider.Postgres.Cli.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack DataProvider/DataProvider.SQLite.Cli/DataProvider.SQLite.Cli.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
dotnet pack Migration/Migration.Cli/Migration.Cli.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkgs
- name: Push to NuGet
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ./nupkgs/*.nupkg
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}