Skip to content

Commit 39f302c

Browse files
committed
Added step to push the NuGet packages when they need to be published.
1 parent 5d5a306 commit 39f302c

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,10 @@ jobs:
439439
id: login
440440
with:
441441
user: dlemstra
442+
443+
- name: Publish NuGet packages
444+
if: needs.version.outputs.publish == 'true'
445+
env:
446+
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
447+
run: ../publish/push.cmd
448+
working-directory: packages

publish/push.cmd

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
@echo off
22

3-
echo Are you sure?
4-
pause
3+
if "%NUGET_API_KEY%"=="" (
4+
echo Error: NUGET_API_KEY environment variable is not set
5+
exit /b 1
6+
)
57

6-
set /p ApiKey=<../keys/nuget.txt
7-
if not "%ApiKey%"=="" goto push
8+
echo Waiting 5 minutes before pushing packages...
9+
timeout /t 300 /nobreak
810

9-
echo Unable to find nuget.txt in the keys folder.
10-
goto done
11-
12-
:push
13-
for /r %%i in (*.nupkg) do ..\tools\windows\nuget.exe push %%i %ApiKey% -Source nuget.org
14-
15-
:done
16-
pause
11+
for /r %%i in (*.nupkg) do ..\tools\windows\nuget.exe push %%i -ApiKey %NUGET_API_KEY% -Source "https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)