Skip to content

Commit 8c30f43

Browse files
authored
Update dotnet.yml
1 parent ef5a539 commit 8c30f43

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/dotnet.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Dotnet CI build
1+
name: Dotnet build & publish
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
75
branches: [ develop, main ]
86

97
jobs:
@@ -16,15 +14,21 @@ jobs:
1614

1715
steps:
1816
- uses: actions/checkout@v3
17+
- name: Setup MSBuild
18+
uses: microsoft/setup-msbuild@v1.1.3
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v3
2121
with:
2222
dotnet-version: 7.0.x
23-
- name: Install MAUI workload
24-
run: dotnet workload install maui
2523
- name: Install dependencies
2624
run: dotnet restore $SOLUTION
2725
- name: Build
28-
run: dotnet build $SOLUTION --configuration Release --no-restore
29-
- name: Create the package
30-
run: dotnet pack $SOLUTION --configuration Release
26+
run: msbuild $SOLUTION -p:Configuration=Release -p:RestorePackages=false -verbosity:minimal
27+
28+
publish:
29+
runs-on: windows-latest
30+
needs: build
31+
if: github.ref == 'refs/heads/main' # Deploy for main branch
32+
steps:
33+
- name: Publish the package to Nuget.org
34+
run: dotnet nuget push **\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.PUBLISH_TO_NUGET_ORG}} --skip-duplicate

0 commit comments

Comments
 (0)