-
-
Notifications
You must be signed in to change notification settings - Fork 390
123 lines (106 loc) · 4.37 KB
/
draft-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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/[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: Get Flurl.Http.Newtonsoft csproj version
id: csproj_ver_flurl_newtonsoft
uses: KageKirin/[email protected]
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/[email protected]
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.${{ 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