|
| 1 | +name: Full Continuous Integration |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + pack: |
| 7 | + name: Build (${{ matrix.os }}) |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: [ ubuntu-latest, windows-latest, macOS-latest ] |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Get source |
| 16 | + uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Setup .NET Core 3.1 |
| 19 | + uses: actions/setup-dotnet@v1 |
| 20 | + with: |
| 21 | + dotnet-version: 3.1.406 |
| 22 | + |
| 23 | + - name: Build |
| 24 | + run: dotnet build -c Release -v minimal -p:WarningLevel=3 |
| 25 | + |
| 26 | + - name: Test |
| 27 | + run: dotnet test -c Release --no-build |
| 28 | + shell: bash # defaults disagree on how to quote the filter string |
| 29 | + |
| 30 | + - name: Pack |
| 31 | + run: dotnet pack -c Release --no-build -o artifacts -p:NoWarn=NU5105 |
| 32 | + |
| 33 | + - name: Upload |
| 34 | + uses: actions/upload-artifact@v2 |
| 35 | + with: |
| 36 | + name: NuGet Package Files (${{ matrix.os }}) |
| 37 | + path: artifacts |
| 38 | + |
| 39 | + deployToMyGet: |
| 40 | + name: Deploy to MyGet |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + needs: pack |
| 44 | + if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Setup .NET Core 3.1 |
| 48 | + uses: actions/setup-dotnet@v1 |
| 49 | + with: |
| 50 | + dotnet-version: 3.1.406 |
| 51 | + |
| 52 | + - name: Download Package Files |
| 53 | + uses: actions/download-artifact@v2 |
| 54 | + with: |
| 55 | + name: NuGet Package Files (ubuntu-latest) |
| 56 | + path: artifacts |
| 57 | + |
| 58 | + - name: Publish Package Files to MyGet |
| 59 | + run: dotnet nuget push artifacts/*.nupkg -s https://www.myget.org/F/nettopologysuite/api/v3/index.json -k $MYGET_API_KEY |
| 60 | + shell: bash |
| 61 | + env: |
| 62 | + MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} |
| 63 | + |
| 64 | + deployToNuGet: |
| 65 | + name: Deploy to NuGet |
| 66 | + runs-on: ubuntu-latest |
| 67 | + |
| 68 | + needs: pack |
| 69 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 70 | + |
| 71 | + steps: |
| 72 | + - name: Setup .NET Core 3.1 |
| 73 | + uses: actions/setup-dotnet@v1 |
| 74 | + with: |
| 75 | + dotnet-version: 3.1.406 |
| 76 | + |
| 77 | + - name: Download Package Files |
| 78 | + uses: actions/download-artifact@v2 |
| 79 | + with: |
| 80 | + name: NuGet Package Files (ubuntu-latest) |
| 81 | + path: artifacts |
| 82 | + |
| 83 | + - name: Publish Package Files to NuGet |
| 84 | + run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY |
| 85 | + shell: bash |
| 86 | + env: |
| 87 | + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |
| 88 | + |
0 commit comments