StarFederation.Datastar Nuget #6
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: StarFederation.Datastar Nuget | |
| on: | |
| workflow_dispatch: | |
| env: | |
| NuGetDirectory: ${{ github.workspace }}/nuget | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Build and Pack NuGet package with versioning | |
| run: dotnet pack src/csharp/StarFederation.Datastar.csproj --configuration Release --output ${{ env.NuGetDirectory }} | |
| - name: Upload NuGet package to GitHub | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nugetPackage | |
| path: ${{ env.NuGetDirectory }}/*.nupkg | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download nuget package artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nugetPackage | |
| path: nugetPackage | |
| - name: Publish to NuGet.org | |
| run: dotnet nuget push nugetPackage/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |