forked from microsoft/sarif-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPublishSignedPackages.cmd
33 lines (26 loc) · 949 Bytes
/
PublishSignedPackages.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
call SetCurrentVersion.cmd
if "%PRERELEASE%" EQU "-developer" (
echo Attempt to push working bits. Fix prerelease value and rebuild && goto Exit)
)
set VERSION=%MAJOR%.%MINOR%.%PATCH%%PRERELEASE%
set NUGET=.nuget\nuget.exe
set SOURCE=https://nuget.org
if exist ..\SetNugetSarifKey.cmd (
call ..\SetNugetSarifKey.cmd
call %NUGET% SetApiKey %API_KEY% -Source %SOURCE%
)
if "%ERRORLEVEL%" NEQ "0" (echo set api key of %API_KEY% to %SOURCE% FAILED && goto Exit)
call :PublishPackage Sarif.Sdk || goto :EOF
call :PublishPackage Sarif.Converters || goto :EOF
call :PublishPackage Sarif.Driver || goto :EOF
call :PublishPackage Sarif.Multitool || goto :EOF
goto :EOF
:PublishPackage
set ID=%1
set PRERELEASE=%2
set PACKAGE_ROOT=.\bld\bin\nuget\%ID%.%VERSION%%PRERELEASE%
call %NUGET% push %PACKAGE_ROOT%.symbols.nupkg -Source %SOURCE%
if "%ERRORLEVEL%" NEQ "0" (echo Push of %ID% to %SOURCE% failed.)
Exit /B %ERRORLEVEL%
:EOF