@@ -12,37 +12,62 @@ runs:
12
12
using : " composite"
13
13
steps :
14
14
- name : Break if no NUGET_APIKEY
15
+ shell : bash
15
16
if : ${{ inputs.NUGET_APIKEY == '' }}
16
17
run : exit 1
18
+
17
19
- id : lastVersion
18
20
name : lastVersion
19
21
uses : pozetroninc/github-action-get-latest-release@master
20
22
with :
21
23
repository : ${{ github.repository }}
24
+
25
+ - name : Show release version
26
+ shell : bash
27
+ run : echo Release version ${{ steps.lastVersion.outputs.release }}
28
+ - name : Break if no release version
29
+ shell : bash
30
+ if : ${{ steps.lastVersion.outputs.release == '' }}
31
+ run : exit 1
32
+
33
+ - uses : actions-ecosystem/action-regex-match@v2
34
+ id : regex-match
35
+ name : regex-match
36
+ with :
37
+ text : ${{ steps.lastVersion.outputs.release }}
38
+ regex : ' \d+\.\d+\.\d+(\.\d+)?'
39
+
40
+ - name : Show nuget version
41
+ shell : bash
42
+ run : echo Version match ${{ steps.regex-match.outputs.match }}
43
+ - name : Break if no nuget version
44
+ shell : bash
45
+ if : ${{ steps.regex-match.outputs.match == '' }}
46
+ run : exit 1
47
+
22
48
- name : Checkout
23
49
uses : actions/checkout@v3
24
50
with :
25
51
ref : ${{ steps.lastVersion.outputs.release }}
52
+
26
53
- name : Setup .NET SDK
27
54
uses : actions/setup-dotnet@v3
28
55
- name : Build
29
- working-directory : ${{ inputs.working-directory }}
56
+ shell : bash
57
+ working-directory : ./JsonProperty.EFCore
30
58
run : dotnet build -c Release
31
59
- name : Test
60
+ shell : bash
32
61
run : dotnet test -c Release
33
- - uses : actions-ecosystem/action-regex-match@v2
34
- id : regex-match
35
- name : regex-match
36
- with :
37
- text : ${{ steps.lastVersion.outputs.release }}
38
- regex : ' \d+\.\d+\.\d+(\.\d+)?'
39
- - name : Break if no version
40
- if : ${{ steps.regex-match.outputs.match == '' }}
41
- run : exit 1
62
+
42
63
- name : Pack nugets
64
+ if : ${{ steps.regex-match.outputs.match != '' }}
65
+ shell : bash
43
66
working-directory : ${{ inputs.working-directory }}
44
- run : dotnet pack -c Release -p:Version=${{ steps.regex-match.outputs.group1 }} -p:PackageVersion=${{ steps.regex-match.outputs.group1 }} --no-build --output .
67
+ run : dotnet pack -c Release -p:Version=${{ steps.regex-match.outputs.match }} -p:PackageVersion=${{ steps.regex-match.outputs.match }} --no-build --output .
45
68
- name : Push to NuGet
69
+ if : ${{ steps.regex-match.outputs.match != '' }}
70
+ shell : bash
46
71
working-directory : ${{ inputs.working-directory }}
47
72
run : dotnet nuget push "*.nupkg" --api-key ${{ inputs.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
48
73
branding :
0 commit comments