1313SET projectName = %1
1414SET certFile = %2
1515SET certPass = %3
16-
17- :: Constants
18- SET containerName = EasyPost
19- SET buildMode = " Release"
20- SET buildPlatform = " Any CPU"
16+ SET containerName = %4
17+ SET buildMode = %5
2118
2219:: Delete old files
23- @ ECHO :
24- @ ECHO Cleaning old files...
25- @ RD /S /Q lib
26- DEL /S /Q /F *.nupkg
20+ CALL " scripts\delete_old_assemblies.bat"
2721
2822:: Install certificate (needed to automate signing later on)
29- @ ECHO :
30- @ ECHO (Re-)Installing certificate to system...
31- sn -d " %containerName% "
32- SnInstallPfx " %certFile% " " %certPass% " " %containerName% " || GOTO :commandFailed
23+ CALL " scripts\install_cert.bat" %certFile% %certPass% %containerName% || GOTO :commandFailed
3324
3425:: Restore dependencies and build solution
35- @ ECHO :
36- @ ECHO Restoring and building project...
37- dotnet msbuild -property:Configuration=" %buildMode% " -property:Platform=" %buildPlatform" -target:Rebuild -restore || GOTO :commandFailed
26+ CALL " scripts\build_project.bat" %buildMode% || GOTO :commandFailed
3827
3928:: Sign the DLLs
40- @ ECHO :
41- @ ECHO Signing DLLs with certificate...
42- FOR /R lib %%F IN (*.dll) DO (
43- REM We need to run the DLLs through both sn.exe and signtool to get complete the signing process
44- sn -Rca " %%F " " %containerName% " || GOTO :commandFailed
45- signtool sign /f " %certFile% " /p " %certPass% " /v /tr http://timestamp.digicert.com?alg=sha256 /td SHA256 /fd SHA256 " %%F " || GOTO :commandFailed
46- )
29+ CALL " scripts\sign_dlls.bat" %certFile% %certPass% %containerName% || GOTO :commandFailed
4730
4831:: Package the DLLs in a NuGet package (will fail if DLLs are missing)
49- @ ECHO :
50- @ ECHO Generating NuGet package...
51- nuget pack %projectName% .nuspec || GOTO :commandFailed
32+ CALL " scripts\pack_nuget.bat" %projectName% || GOTO :commandFailed
5233
5334:: Sign the NuGet package
54- @ ECHO :
55- @ ECHO Signing NuGet package with certificate...
56- :: Should only be one .nupkg file at this point, since we deleted the old ones
35+ CALL " scripts\sign_nuget.bat" %certFile% %certPass% || GOTO :commandFailed
5736SET nugetFileName =
5837FOR /R %%F IN (*.nupkg) DO (
5938 SET nugetFileName = " %%F "
60- nuget sign " %%F " -Timestamper http://timestamp.digicert.com -CertificatePath " %certFile% " -CertificatePassword " %certPass% " || GOTO :commandFailed
6139)
6240IF [%nugetFileName% ]== [] (
63- ECHO Could not find NuGet package to sign .
41+ ECHO Could not find NuGet package.
6442 GOTO :exitWithError
6543)
6644
@@ -77,7 +55,7 @@ GOTO :eof
7755GOTO :exitWithError
7856
7957:commandFailed
80- @ ECHO Command failed.
58+ @ ECHO Step failed.
8159GOTO :exitWithError
8260
8361:exitWithError
0 commit comments