Merge pull request #208 from Infarh/dev #16
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.org | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '.github/workflows/**' | |
| - '**.md' | |
| - '**.docx' | |
| - '**.bat' | |
| - '**.vssettings' | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Cache NuGet | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget | |
| - name: Restore | |
| run: | | |
| dotnet restore MathCore.DSP | |
| dotnet restore Tests/MathCore.DSP.Tests | |
| - name: Building | |
| run: | | |
| dotnet build MathCore.DSP -c Release --no-restore --nowarn:CS1998,CS8625,CS8600,CS8603,CS8620,CS8618,CS8604,CS8602,CS8622,CS8619,CS8632,CS0108,NU1701,NU1702,MSB3277,NU1701 | |
| dotnet build Tests/MathCore.DSP.Tests -c Release --no-restore --nowarn:CS1998,CS8625,CS8600,CS8603,CS8620,CS8618,CS8604,CS8602,CS8622,CS8619,CS8632,CS0108,NU1701,NU1702,MSB3277,NU1701 | |
| - name: Run Tests | |
| run: dotnet test Tests/MathCore.DSP.Tests --no-build -c Release | |
| - name: Packing | |
| run: dotnet pack MathCore.DSP --no-build -c Release -v q -o ${{ github.workspace }}/ReleasePack --include-symbols | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4.6.0 | |
| with: | |
| name: Release | |
| path: ${{ github.workspace }}/ReleasePack | |
| retention-days: 1 | |
| nuget: | |
| name: NuGet | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get artifact | |
| uses: actions/download-artifact@v4.1.7 | |
| id: download | |
| with: | |
| name: Release | |
| path: ${{ github.workspace }}/ReleasePack | |
| - name: Upload to NuGet | |
| run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NuGetApiKey }} --skip-duplicate -s https://api.nuget.org/v3/index.json | |
| github: | |
| name: GitHub | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get artifact | |
| uses: actions/download-artifact@v4.1.7 | |
| id: download | |
| with: | |
| name: Release | |
| path: ${{ github.workspace }}/ReleasePack | |
| - name: Upload to GitHub | |
| run: dotnet nuget push "**/*.nupkg" --skip-duplicate -s https://nuget.pkg.github.com/Infarh/index.json -k ${{secrets.GITHUB_TOKEN}} | |
| clean: | |
| name: Clean artifact | |
| needs: [nuget, github] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Delete artefact | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: Release |