|
@@ -0,0 +1,47 @@
|
|
|
+name: Publish
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ tags:
|
|
|
+ - 'v*.*.*'
|
|
|
+
|
|
|
+jobs:
|
|
|
+ build:
|
|
|
+
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ env:
|
|
|
+ DOTNET_NOLOGO: true
|
|
|
+ DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - name: Checkout source code
|
|
|
+ uses: actions/checkout@v2
|
|
|
+
|
|
|
+ - name: Setup dotnet 2.1
|
|
|
+ uses: actions/setup-dotnet@v1
|
|
|
+ with:
|
|
|
+ dotnet-version: 2.1.*
|
|
|
+
|
|
|
+ - name: Setup dotnet 3.1
|
|
|
+ uses: actions/setup-dotnet@v1
|
|
|
+ with:
|
|
|
+ dotnet-version: 3.1.*
|
|
|
+
|
|
|
+ - name: Setup dotnet 5.0
|
|
|
+ uses: actions/setup-dotnet@v1
|
|
|
+ with:
|
|
|
+ dotnet-version: 5.0.*
|
|
|
+
|
|
|
+ - name: Test
|
|
|
+ run: dotnet test --configuration Release
|
|
|
+
|
|
|
+ - name: Pack with dotnet
|
|
|
+ run: |
|
|
|
+ arrTag=(${GITHUB_REF//\// })
|
|
|
+ VERSION="${arrTag[2]}"
|
|
|
+ VERSION="${VERSION//v}"
|
|
|
+ echo "$VERSION"
|
|
|
+ dotnet pack --output artifacts --configuration Release -p:Version=$VERSION
|
|
|
+
|
|
|
+ - name: Push with dotnet
|
|
|
+ run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
|