Skip to content

Commit 17d937b

Browse files
committed
Update action.yml
1 parent ccc0241 commit 17d937b

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

action.yml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,62 @@ runs:
1212
using: "composite"
1313
steps:
1414
- name: Break if no NUGET_APIKEY
15+
shell: bash
1516
if: ${{ inputs.NUGET_APIKEY == '' }}
1617
run: exit 1
18+
1719
- id: lastVersion
1820
name: lastVersion
1921
uses: pozetroninc/github-action-get-latest-release@master
2022
with:
2123
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+
2248
- name: Checkout
2349
uses: actions/checkout@v3
2450
with:
2551
ref: ${{ steps.lastVersion.outputs.release }}
52+
2653
- name: Setup .NET SDK
2754
uses: actions/setup-dotnet@v3
2855
- name: Build
29-
working-directory: ${{ inputs.working-directory }}
56+
shell: bash
57+
working-directory: ./JsonProperty.EFCore
3058
run: dotnet build -c Release
3159
- name: Test
60+
shell: bash
3261
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+
4263
- name: Pack nugets
64+
if: ${{ steps.regex-match.outputs.match != '' }}
65+
shell: bash
4366
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 .
4568
- name: Push to NuGet
69+
if: ${{ steps.regex-match.outputs.match != '' }}
70+
shell: bash
4671
working-directory: ${{ inputs.working-directory }}
4772
run: dotnet nuget push "*.nupkg" --api-key ${{ inputs.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
4873
branding:

0 commit comments

Comments
 (0)