Skip to content

Commit

Permalink
Add clearer logging to buildfile
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Dec 16, 2021
1 parent 3fcb3d4 commit 1f7a706
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ if exist src\nvm.exe (
)

REM Make the executable and add to the binary directory
echo ----------------------------
echo Building nvm.exe
echo ----------------------------
cd .\src
go build nvm.go

Expand All @@ -21,7 +23,9 @@ move nvm.exe %GOBIN%
cd ..\

REM Codesign the executable
echo ----------------------------
echo Sign the nvm executable...
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %GOBIN%\nvm.exe

for /f %%i in ('"%GOBIN%\nvm.exe" version') do set AppVersion=%%i
Expand All @@ -32,7 +36,9 @@ SET DIST=%CD%\dist\%AppVersion%

REM Remove old build files if they exist.
if exist %DIST% (
echo ----------------------------
echo Clearing old build in %DIST%
echo ----------------------------
rd /s /q "%DIST%"
)

Expand All @@ -43,35 +49,58 @@ REM Create the "no install" zip version
for %%a in ("%GOBIN%") do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" %%a\* -x "%GOBIN%\nodejs.ico")

REM Generate update utility
echo ----------------------------
echo Generating update utility...
echo ----------------------------
cd .\updater
go build nvm-update.go
echo Sign the updater...
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a nvm-update.exe
move nvm-update.exe %DIST%
cd ..\

REM Generate the installer (InnoSetup)
echo ----------------------------
echo Generating installer...
echo ----------------------------
buildtools\iscc "%INNOSETUP%" "/o%DIST%"

echo ----------------------------
echo Sign the installer
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %DIST%\nvm-setup.exe
echo Bundle the installer/updater...

echo ----------------------------
echo Sign the updater...
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %DIST%\nvm-update.exe

echo ----------------------------
echo Bundle the installer...
echo ----------------------------
buildtools\zip -j -9 -r "%DIST%\nvm-setup.zip" "%DIST%\nvm-setup.exe"


echo ----------------------------
echo Bundle the updater...
echo ----------------------------
buildtools\zip -j -9 -r "%DIST%\nvm-update.zip" "%DIST%\nvm-update.exe"

del %DIST%\nvm-update.exe
del %DIST%\nvm-setup.exe

REM Generate checksums
echo ----------------------------
echo Generating checksums...
echo ----------------------------
for %%f in (%DIST%\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")
echo complete

echo ----------------------------
echo Cleaning up...
REM Cleanup
echo ----------------------------
del %GOBIN%\nvm.exe
echo complete
@REM del %GOBIN%\nvm-update.exe
@REM del %GOBIN%\nvm-setup.exe

echo NVM for Windows v%AppVersion% build completed.
echo NVM for Windows v%AppVersion% build completed. Available in %DIST%
@echo on

1 comment on commit 1f7a706

@Mira779
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't authorize github on my desktop . Please help me with some ideas.

Please sign in to comment.