Merge pull request #771 from tmenier/dev #5
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]*\" /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/[email protected] | |
with: | |
file: src/Flurl/Flurl.csproj | |
- name: Get Flurl latest release tag | |
id: release_ver_flurl | |
uses: oprypin/[email protected] | |
with: | |
repository: tmenier/Flurl | |
releases-only: true | |
regex: '^Flurl\.\d+' | |
- name: Get Flurl.Http csproj version | |
id: csproj_ver_flurl_http | |
uses: KageKirin/[email protected] | |
with: | |
file: src/Flurl.Http/Flurl.Http.csproj | |
- name: Get Flurl.Http latest release tag | |
id: release_ver_flurl_http | |
uses: oprypin/[email protected] | |
with: | |
repository: tmenier/Flurl | |
releases-only: true | |
regex: '^Flurl\.Http\.\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 }}" | |
- 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 |