|
| 1 | +name: Release to NuGet |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + package: |
| 13 | + [ |
| 14 | + Protobuf.System.Text.Json |
| 15 | + ] |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v1 |
| 18 | + - name: Setup .NET Core |
| 19 | + uses: actions/setup-dotnet@v1 |
| 20 | + with: |
| 21 | + dotnet-version: "6.0.x" |
| 22 | + - name: Create NuGet Package |
| 23 | + run: dotnet pack -c Release /p:Version=${{ github.event.release.name }} /p:PackageReleaseNotes="See https://github.com/Havret/dotnet-activemq-artemis-client/releases/tag/${{ github.event.release.tag_name }}" |
| 24 | + - name: Archive NuGet Package |
| 25 | + uses: actions/upload-artifact@v1 |
| 26 | + with: |
| 27 | + name: ${{ matrix.package }} |
| 28 | + path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg |
| 29 | + - name: Archive NuGet Package With Symbols |
| 30 | + uses: actions/upload-artifact@v1 |
| 31 | + with: |
| 32 | + name: ${{ matrix.package }} |
| 33 | + path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.snupkg |
| 34 | + - name: Publish NuGet Package |
| 35 | + run: dotnet nuget push ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json |
| 36 | + - name: Upload NuGet Package |
| 37 | + uses: actions/upload-release-asset@v1 |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + upload_url: ${{ github.event.release.upload_url }} |
| 42 | + asset_path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg |
| 43 | + asset_name: ${{ matrix.package }}.${{ github.event.release.name }}.nupkg |
| 44 | + asset_content_type: application/zip |
| 45 | + - name: NuGet Package With Symbols |
| 46 | + uses: actions/upload-release-asset@v1 |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + with: |
| 50 | + upload_url: ${{ github.event.release.upload_url }} |
| 51 | + asset_path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.snupkg |
| 52 | + asset_name: ${{ matrix.package }}.${{ github.event.release.name }}.snupkg |
| 53 | + asset_content_type: application/zip |
0 commit comments