File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -27,26 +27,37 @@ jobs:
27
27
- name : Build
28
28
run : dotnet build FastTrack/FastTrack.csproj --configuration Release --no-restore
29
29
30
+
31
+ - name : Set workspace and nupkg output directory
32
+ id : vars
33
+ run : |
34
+ echo "::set-output name=workspace::${{ github.workspace }}"
35
+ echo "::set-output name=nupkgdir::${{ github.workspace }}/nupkgs"
36
+
30
37
- name : Pack NuGet package
31
- run : dotnet pack FastTrack/FastTrack.csproj --configuration Release --no-build --output nupkgs
38
+ run : dotnet pack FastTrack/FastTrack.csproj --configuration Release --no-build --output "${{ steps.vars.outputs.nupkgdir }}"
39
+
32
40
33
41
- name : List contents of nupkgs directory
34
42
run : |
35
43
echo "Listing contents of nupkgs directory:"
36
- dir nupkgs
44
+ dir "${{ steps.vars.outputs.nupkgdir }}"
45
+
37
46
38
47
- name : Fail if no .nupkg found
39
48
run : |
40
- if (!(Test-Path -Path "nupkgs /*.nupkg")) { Write-Error "No .nupkg file found in nupkgs directory."; exit 1 }
49
+ if (!(Test-Path -Path "${{ steps.vars.outputs.nupkgdir }} /*.nupkg")) { Write-Error "No .nupkg file found in nupkgs directory."; exit 1 }
41
50
shell : pwsh
42
51
52
+
43
53
- name : Publish to NuGet.org
44
54
uses : actions/upload-artifact@v4
45
55
with :
46
56
name : fasttrack-nuget
47
- path : nupkgs/*.nupkg
57
+ path : ${{ steps.vars.outputs.nupkgdir }}/*.nupkg
58
+
48
59
49
60
- name : Push package to NuGet.org
50
- run : dotnet nuget push nupkgs /*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
61
+ run : dotnet nuget push "${{ steps.vars.outputs.nupkgdir }}" /*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
51
62
env :
52
63
NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
You can’t perform that action at this time.
0 commit comments