Merge pull request #788 from tmenier/dev #15
This file contains 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: Draft Release | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: # manual trigger | |
jobs: | |
build_test_pack: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
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]*,[Flurl.Http.Newtonsoft]*\" /p:Exclude="[*]*.GeneratedExtensions" | |
# Compare version from csproj with latest release tag. | |
# If different, create a draft release. | |
- name: Get Flurl csproj version | |
id: csproj_ver_flurl | |
uses: KageKirin/get-csproj-version@v1.0.0 | |
with: | |
file: src/Flurl/Flurl.csproj | |
- name: Get Flurl latest release tag | |
id: release_ver_flurl | |
uses: oprypin/find-latest-tag@v1.1.1 | |
with: | |
repository: tmenier/Flurl | |
releases-only: true | |
regex: '^Flurl\.\d+' | |
- name: Get Flurl.Http csproj version | |
id: csproj_ver_flurl_http | |
uses: KageKirin/get-csproj-version@v1.0.0 | |
with: | |
file: src/Flurl.Http/Flurl.Http.csproj | |
- name: Get Flurl.Http latest release tag | |
id: release_ver_flurl_http | |
uses: oprypin/find-latest-tag@v1.1.1 | |
with: | |
repository: tmenier/Flurl | |
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: | |
CURRENT_TAG: ${{ steps.release_ver_flurl.outputs.tag }} | |
NEXT_TAG: "Flurl.${{ steps.csproj_ver_flurl.outputs.version }}" | |
RELEASE_NAME: "Flurl ${{ steps.csproj_ver_flurl.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 | |
- name: Draft Flurl.Http release | |
env: | |
CURRENT_TAG: ${{ steps.release_ver_flurl_http.outputs.tag }} | |
NEXT_TAG: "Flurl.Http.${{ steps.csproj_ver_flurl_http.outputs.version }}" | |
RELEASE_NAME: "Flurl.Http ${{ steps.csproj_ver_flurl_http.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 | |
- name: Draft Flurl.Http.Newtonsoft release | |
env: | |
CURRENT_TAG: ${{ steps.release_ver_flurl_newtonsoft.outputs.tag }} | |
NEXT_TAG: "Flurl.Http.Newtonsoft.${{ steps.csproj_ver_flurl_newtonsoft.outputs.version }}" | |
RELEASE_NAME: "Flurl.Http.Newtonsoft ${{ 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 |