Update PackageIds to follow ModelingEvolution naming convention #2
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 Packages | |
| on: | |
| push: | |
| tags: | |
| - 'nng/*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g., 1.0.0)' | |
| required: true | |
| type: string | |
| env: | |
| DOTNET_VERSION: '10.0.x' | |
| CONFIGURATION: Release | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 9.0.x | |
| 10.0.x | |
| - name: Extract version from tag | |
| id: get_version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| else | |
| # Extract version from tag format: nng/1.0.0 | |
| VERSION=${GITHUB_REF#refs/tags/nng/} | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing version: $VERSION" | |
| - name: Restore nng.NET.Shared dependencies | |
| run: dotnet restore nng.NET.Shared/nng.NET.Shared.csproj | |
| - name: Build nng.NET.Shared | |
| run: dotnet build nng.NET.Shared/nng.NET.Shared.csproj --configuration ${{ env.CONFIGURATION }} --no-restore /p:Version=${{ steps.get_version.outputs.VERSION }} | |
| - name: Pack nng.NET.Shared | |
| run: | | |
| dotnet pack nng.NET.Shared/nng.NET.Shared.csproj \ | |
| --configuration ${{ env.CONFIGURATION }} \ | |
| --no-build \ | |
| --output ./artifacts \ | |
| /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} \ | |
| /p:IncludeSymbols=true \ | |
| /p:SymbolPackageFormat=snupkg | |
| - name: Restore nng.NET dependencies | |
| run: dotnet restore nng.NET/nng.NET.csproj | |
| - name: Build nng.NET | |
| run: dotnet build nng.NET/nng.NET.csproj --configuration ${{ env.CONFIGURATION }} --no-restore /p:Version=${{ steps.get_version.outputs.VERSION }} | |
| - name: Pack nng.NET | |
| run: | | |
| dotnet pack nng.NET/nng.NET.csproj \ | |
| --configuration ${{ env.CONFIGURATION }} \ | |
| --no-build \ | |
| --output ./artifacts \ | |
| /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} \ | |
| /p:IncludeSymbols=true \ | |
| /p:SymbolPackageFormat=snupkg | |
| - name: List artifacts | |
| run: ls -lh ./artifacts | |
| - name: Publish to NuGet.org | |
| run: | | |
| dotnet nuget push "./artifacts/*.nupkg" \ | |
| --api-key ${{ secrets.NUGET_API_KEY }} \ | |
| --source https://api.nuget.org/v3/index.json \ | |
| --skip-duplicate | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages-${{ steps.get_version.outputs.VERSION }} | |
| path: ./artifacts/*.nupkg | |
| retention-days: 30 |