name: Net.Sdk.Web.Extensions CD Pipeline on: push: branches: - master paths: - Net.Sdk.Web.Extensions/** - Net.Sdk.Web.Extensions.Azure/** - ".github/workflows/cd.yaml" jobs: build: environment: Default strategy: matrix: targetplatform: [x64] runs-on: windows-latest env: Configuration: Release Solution_Path: Net.Sdk.Web.Extensions.sln Source_Project_Path: Net.Sdk.Web.Extensions\Net.Sdk.Web.Extensions.csproj Azure_Project_path: Net.Sdk.Web.Extensions.Azure\Net.Sdk.Web.Extensions.Azure.csproj Actions_Allow_Unsecure_Commands: true steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install .NET Core uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.0.1 - name: Restore project run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier env: RuntimeIdentifier: win-${{ matrix.targetplatform }} - name: Build Net.Sdk.Extensions project run: dotnet build $env:Source_Project_Path -c $env:Configuration - name: Package Net.Sdk.Extensions run: dotnet pack -c Release -o . $env:Source_Project_Path - name: Build Net.Sdk.Extensions.Azure project run: dotnet build $env:Azure_Project_Path -c $env:Configuration - name: Package Net.Sdk.Extensions.Azure run: dotnet pack -c Release -o . $env:Azure_Project_Path - name: Publish run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate