@@ -11,10 +11,9 @@ permissions:
1111 packages : write
1212
1313env :
14- SOLUTION_PATH : SimpleMapper/SimpleMapper.sln
15- PACKAGE_PROJECT_PATH : SimpleMapper/ SimpleMapper/SimpleMapper/SimpleMapper.csproj
14+ SOLUTION_FILE : SimpleMapper/SimpleMapper.sln
15+ PROJECT_FILE : SimpleMapper/SimpleMapper/SimpleMapper.csproj
1616 PACKAGE_OUTPUT_DIRECTORY : ${{ github.workspace }}/output
17- NUGET_SOURCE_URL : https://api.nuget.org/v3/index.json
1817
1918jobs :
2019 build-and-pack :
@@ -23,24 +22,29 @@ jobs:
2322 steps :
2423 - uses : actions/checkout@v4
2524 with :
26- fetch-depth : 0 # Required for tag history
25+ fetch-depth : 0
2726
2827 - name : Setup .NET
2928 uses : actions/setup-dotnet@v3
3029 with :
3130 dotnet-version : 8.0.x
3231
32+ - name : List directory for debugging
33+ run : |
34+ pwd
35+ ls -R SimpleMapper/
36+
3337 - name : Restore dependencies
34- run : dotnet restore ${{ env.SOLUTION_PATH }}
38+ run : dotnet restore " ${{ env.SOLUTION_FILE }}"
3539
3640 - name : Build
37- run : dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore
41+ run : dotnet build " ${{ env.SOLUTION_FILE }}" --configuration Release --no-restore
3842
3943 - name : Create output directory
40- run : mkdir -p ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
44+ run : mkdir -p " ${{ env.PACKAGE_OUTPUT_DIRECTORY }}"
4145
4246 - name : Pack
43- run : dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
47+ run : dotnet pack " ${{ env.PROJECT_FILE }}" --configuration Release --output " ${{ env.PACKAGE_OUTPUT_DIRECTORY }}"
4448
4549 - name : Upload package artifacts
4650 uses : actions/upload-artifact@v4
5357 name : Publish to NuGet
5458 needs : build-and-pack
5559 runs-on : ubuntu-latest
56- if : github.ref == 'refs/heads/main' # Run on push to main branch
60+ if : github.ref == 'refs/heads/main'
5761 steps :
5862 - name : Download package artifacts
5963 uses : actions/download-artifact@v4
6872
6973 - name : Push to NuGet.org
7074 run : |
71- # Create a new NuGet config file
7275 dotnet new nugetconfig --force
73-
74- # Set up NuGet config with API key
75- dotnet nuget add source ${{ env.NUGET_SOURCE_URL }} --name nuget.org
76+ dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org
7677 dotnet nuget push "${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source nuget.org --skip-duplicate
0 commit comments