@@ -10,38 +10,51 @@ jobs:
10
10
11
11
build :
12
12
13
- strategy :
14
- matrix :
15
- configuration : [Release]
16
-
17
13
runs-on : windows-latest
18
14
19
15
env :
20
- Solution_Name : Flow.Launcher.Localization.slnx
21
- Test_Project_Path : Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
16
+ Dotnet_Version : 8.0.x
17
+ Project_Path : Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
18
+ NuGet_Source : ' https://api.nuget.org/v3/index.json'
22
19
23
20
steps :
21
+
22
+ # Checkout codes
24
23
- name : Checkout
25
24
uses : actions/checkout@v4
26
- with :
27
- fetch-depth : 0
28
25
29
26
# Install the .NET Core workload
30
- - name : Install .NET Core
27
+ - name : Setup .NET
31
28
uses : actions/setup-dotnet@v4
32
29
with :
33
- dotnet-version : 7.0.x
30
+ dotnet-version : ${{ env.Dotnet_Version }}
34
31
35
- # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
36
- - name : Setup MSBuild.exe
37
- uses : microsoft/setup-msbuild@v2
32
+ # Restore dependencies
33
+ - name : Restore dependencies
34
+ run : dotnet restore ${{ env.Project_Path }}
35
+
36
+ # Build the project
37
+ - name : Build
38
+ run : dotnet build ${{ env.Project_Path }} --configuration Release --no-restore
38
39
39
40
# Execute all unit tests in the solution
40
41
- name : Execute unit tests
41
- run : dotnet test
42
+ run : dotnet test --configuration Release --no-build
43
+
44
+ # Pack the NuGet package
45
+ - name : Create NuGet package
46
+ run : dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output nupkgs
42
47
43
- # Restore the application to populate the obj folder with RuntimeIdentifiers
44
- - name : Restore the application
45
- run : msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
46
- env :
47
- Configuration : ${{ matrix.configuration }}
48
+ # Upload the NuGet package
49
+ - name : Upload NuGet package
50
+ uses : actions/upload-artifact@v4
51
+ with :
52
+ name : Full nupkg
53
+ path : |
54
+ Flow.Launcher.Localization\bin\Release\Flow.Launcher.Localization.*.nupkg
55
+ compression-level : 0
56
+
57
+ # Publish to NuGet.org
58
+ # - name: Publish to NuGet
59
+ # if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only publish on push to main
60
+ # run: dotnet nuget push ./nupkgs/*.nupkg --source ${{ env.NuGet_Source }} --api-key ${{ secrets.NUGET_API_KEY }}
0 commit comments