Update to .NET 10 - Microsoft.AspNetCore.Components.Web 10.0.0 #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: | |
| - 'hdrsplit/*' | |
| 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: hdrsplit/1.0.0 | |
| VERSION=${GITHUB_REF#refs/tags/hdrsplit/} | |
| fi | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing version: $VERSION" | |
| - name: Restore dependencies | |
| run: dotnet restore src/ModelingEvolution.HdrSplitControl/ModelingEvolution.HdrSplitControl.csproj | |
| - name: Build | |
| run: dotnet build src/ModelingEvolution.HdrSplitControl/ModelingEvolution.HdrSplitControl.csproj --configuration ${{ env.CONFIGURATION }} --no-restore /p:Version=${{ steps.get_version.outputs.VERSION }} | |
| - name: Pack | |
| run: | | |
| dotnet pack src/ModelingEvolution.HdrSplitControl/ModelingEvolution.HdrSplitControl.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 |