Update to Version 1.1 #46
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish NuGet Package | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on version tags like v1.0.0 | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| # ACadSharp is built from source (external/ACadSharp submodule, which | |
| # itself pulls in CSUtilities as a submodule) | |
| submodules: recursive | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| # ACadSharp's TargetFrameworks include net10.0, so restore needs the .NET 10 SDK | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore CADability/CADability.csproj | |
| - name: Build | |
| run: dotnet build CADability/CADability.csproj -c Release --no-restore | |
| - name: Pack | |
| run: dotnet pack CADability/CADability.csproj -c Release --no-build -o ./nupkgs | |
| - name: Login to NuGet | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: dsn27 | |
| - name: Push NuGet package | |
| run: | | |
| $pkg = Get-ChildItem -Path ./nupkgs -Filter "*.nupkg" | Select-Object -First 1 | |
| dotnet nuget push "$($pkg.FullName)" --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |