Skip to content

Commit 5b0c75d

Browse files
authored
#7 fix NuGet push step (#8)
1 parent ec2d90a commit 5b0c75d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/fasttrack-nuget.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,37 @@ jobs:
2727
- name: Build
2828
run: dotnet build FastTrack/FastTrack.csproj --configuration Release --no-restore
2929

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+
3037
- 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+
3240

3341
- name: List contents of nupkgs directory
3442
run: |
3543
echo "Listing contents of nupkgs directory:"
36-
dir nupkgs
44+
dir "${{ steps.vars.outputs.nupkgdir }}"
45+
3746
3847
- name: Fail if no .nupkg found
3948
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 }
4150
shell: pwsh
4251

52+
4353
- name: Publish to NuGet.org
4454
uses: actions/upload-artifact@v4
4555
with:
4656
name: fasttrack-nuget
47-
path: nupkgs/*.nupkg
57+
path: ${{ steps.vars.outputs.nupkgdir }}/*.nupkg
58+
4859

4960
- 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
5162
env:
5263
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)