From 672c358f596e4d11182f6b853b77a2d395fa377d Mon Sep 17 00:00:00 2001 From: Todd Date: Mon, 4 Dec 2023 22:15:34 -0600 Subject: [PATCH] add newtonsoft to release workflow --- .github/workflows/draft-release.yml | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 36afb2e5..cab28e06 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -24,7 +24,7 @@ jobs: run: dotnet build -c Release --no-restore - name: Test - run: dotnet test --no-build -c Release /p:CollectCoverage=true /p:Threshold=80 /p:Include=\"[Flurl]*,[Flurl.Http]*\" /p:Exclude="[*]*.GeneratedExtensions" + run: dotnet test --no-build -c Release /p:CollectCoverage=true /p:Threshold=80 /p:Include=\"[Flurl]*,[Flurl.Http]*,[Flurl.Http.Newtonsoft]*\" /p:Exclude="[*]*.GeneratedExtensions" # Compare version from csproj with latest release tag. # If different, create a draft release. @@ -57,12 +57,28 @@ jobs: releases-only: true regex: '^Flurl\.Http\.\d+' + - name: Get Flurl.Http.Newtonsoft csproj version + id: csproj_ver_flurl_newtonsoft + uses: KageKirin/get-csproj-version@v1.0.0 + with: + file: src/Flurl.Http.Newtonsoft/Flurl.Http.Newtonsoft.csproj + + - name: Get Flurl.Http.Newtonsoft latest release tag + id: release_ver_flurl_newtonsoft + uses: oprypin/find-latest-tag@v1.1.1 + with: + repository: tmenier/Flurl + releases-only: true + regex: '^Flurl\.Http\.Newtonsoft\.\d+' + - name: Output versions run: | echo "Flurl csproj version: ${{ steps.csproj_ver_flurl.outputs.version }}" echo "Flurl latest release tag: ${{ steps.release_ver_flurl.outputs.tag }}" echo "Flurl.Http csproj version: ${{ steps.csproj_ver_flurl_http.outputs.version }}" echo "Flurl.Http latest release tag: ${{ steps.release_ver_flurl_http.outputs.tag }}" + echo "Flurl.Http.Newtonsoft csproj version: ${{ steps.csproj_ver_flurl_newtonsoft.outputs.version }}" + echo "Flurl.Http.Newtonsoft latest release tag: ${{ steps.release_ver_flurl_newtonsoft.outputs.tag }}" - name: Draft Flurl release env: @@ -91,3 +107,17 @@ jobs: generateReleaseNotes: true artifacts: "**/${{ env.NEXT_TAG }}.nupkg,**/${{ env.NEXT_TAG }}.snupkg" draft: true + + - name: Draft Flurl.Http.Newtonsoft release + env: + CURRENT_TAG: ${{ steps.release_ver_flurl_newtonsoft.outputs.tag }} + NEXT_TAG: "Flurl.Http.${{ steps.csproj_ver_flurl_newtonsoft.outputs.version }}" + RELEASE_NAME: "Flurl.Http ${{ steps.csproj_ver_flurl_newtonsoft.outputs.version }}" + if: env.NEXT_TAG != env.CURRENT_TAG + uses: ncipollo/release-action@v1 + with: + name: ${{ env.RELEASE_NAME }} + tag: ${{ env.NEXT_TAG }} + generateReleaseNotes: true + artifacts: "**/${{ env.NEXT_TAG }}.nupkg,**/${{ env.NEXT_TAG }}.snupkg" + draft: true