File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : Build and Deploy to Nuget
2
-
3
2
on :
4
3
push :
5
4
tags :
6
5
- " v*.*.*"
7
- branches : ["main"]
8
6
pull_request :
9
7
branches :
10
8
- main
17
15
runs-on : windows-latest
18
16
steps :
19
17
- name : Checkout repository
20
- uses : actions/checkout@v2
18
+ uses : actions/checkout@v3
21
19
22
20
- name : Set up .NET Core
23
21
uses : actions/setup-dotnet@v3
@@ -27,13 +25,23 @@ jobs:
27
25
- name : Build
28
26
run : dotnet build --configuration ${{ env.BUILD_CONFIG }} ${{ env.SOLUTION }}
29
27
28
+ - name : Set version
29
+ id : set_version
30
+ run : |
31
+ if [[ ${{ github.ref }} == refs/tags/* ]]; then
32
+ echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
33
+ else
34
+ echo "VERSION=0.0.0-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
35
+ fi
36
+
30
37
- name : Package
31
38
run : >
32
39
dotnet pack --no-restore --no-build --configuration ${{ env.BUILD_CONFIG }}
33
- -p:PackageVersion=${{ github.ref_name }} --output .
40
+ -p:PackageVersion=${{ steps.set_version.outputs.VERSION }} --output .
34
41
35
42
- name : Publish
43
+ if : startsWith(github.ref, 'refs/tags/')
36
44
run : >
37
- dotnet nuget push EfLight.${{ github.ref_name }} .nupkg
45
+ dotnet nuget push * .nupkg
38
46
-s https://nuget.pkg.github.com/thiomajid/index.json
39
47
-k ${{ secrets.NUGET_API_KEY }}
You can’t perform that action at this time.
0 commit comments