From 1836f8e3f4cf3337ce9525a970a64ad7cd668bb7 Mon Sep 17 00:00:00 2001 From: Gustavo Leon <1261319+gusty@users.noreply.github.com> Date: Thu, 11 Oct 2018 18:44:43 +0100 Subject: [PATCH] Pad build numbers and prefix PRs This will create stuff like: `MyLib.0.1.0-CI0000798.nupkg` (from master) `MyLib.0.1.0-pr17-0000798.nupkg` (from PRs) --- build.cmd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index 806e875..c3cff58 100644 --- a/build.cmd +++ b/build.cmd @@ -1,8 +1,16 @@ -dotnet pack src/CallPolly --configuration Release -o "%CD%\bin" --version-suffix CI%1 +SETLOCAL +SET X=%1 +SET BLD=000000%X% +SET BLD=%BLD:~-7% +if [%2]==[] (SET V=CI%BLD%) else (SET V=pr%2-%BLD%) + +dotnet pack src/CallPolly --configuration Release -o "%CD%\bin" --version-suffix %V% if ERRORLEVEL 1 (echo Error building CallPolly; exit /b 1) dotnet test tests/CallPolly.Tests --configuration Release if ERRORLEVEL 1 (echo Error testing CallPolly; exit /b 1) dotnet test tests/CallPolly.Acceptance --configuration Release -if ERRORLEVEL 1 (echo Error acceptance testing CallPolly; exit /b 1) \ No newline at end of file +if ERRORLEVEL 1 (echo Error acceptance testing CallPolly; exit /b 1) + +ENDLOCAL