Skip to content

Commit

Permalink
updated preview builder
Browse files Browse the repository at this point in the history
  • Loading branch information
vpenades committed Jan 9, 2020
1 parent 0fa1cdc commit b0385fd
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions src/build-preview.cmd
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
@echo off

:: Check WMIC is available
WMIC.EXE Alias /? >NUL 2>&1 || GOTO s_error
set GETTIMEKEY=powershell get-date -format "{yyyyMMdd-HHmm}"
for /f %%i in ('%GETTIMEKEY%') do set TIMEKEY=%%i

:: Use WMIC to retrieve date and time
FOR /F "skip=1 tokens=1-6" %%G IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
IF "%%~L"=="" goto s_done
Set _YYYY=%%L
Set _MM=00%%J
Set _DD=00%%G
Set _HOUR=00%%H
SET _MINUTE=00%%I
)
:s_done
set VERSIONSUFFIX=Preview-%TIMEKEY%

:: Pad digits with leading zeros
Set _MM=%_MM:~-2%
Set _DD=%_DD:~-2%
Set _HOUR=%_HOUR:~-2%
Set _MINUTE=%_MINUTE:~-2%
echo Building 1.0.0-%VERSIONSUFFIX%

:: Display the date/time in ISO 8601 format:
Set _ISODATE=%_YYYY%-%_MM%-%_DD% %_HOUR%:%_MINUTE%
Echo %_ISODATE%
dotnet build -c:Release --version-suffix %VERSIONSUFFIX% /p:Authors=vpenades SharpGLTF.Core\SharpGLTF.Core.csproj
dotnet build -c:Release --version-suffix %VERSIONSUFFIX% /p:Authors=vpenades SharpGLTF.Toolkit\SharpGLTF.Toolkit.csproj

set VERSIONSUFFIX=Preview-%_YYYY%%_MM%%_DD%-%_HOUR%%_MINUTE%
dotnet nuget push "SharpGLTF.Core/bin/Release/SharpGLTF.Core.1.0.0-%VERSIONSUFFIX%.nupkg" -s "github" --force-english-output
dotnet nuget push "SharpGLTF.Toolkit/bin/Release/SharpGLTF.Toolkit.1.0.0-%VERSIONSUFFIX%.nupkg" -s "github" --force-english-output

echo Building %VERSIONSUFFIX%

dotnet build -c:Release --version-suffix %VERSIONSUFFIX% SharpGLTF.Core\SharpGLTF.Core.csproj
dotnet build -c:Release --version-suffix %VERSIONSUFFIX% SharpGLTF.Toolkit\SharpGLTF.Toolkit.csproj

rem dotnet nuget push "SharpGLTF.Core/bin/Release/SharpGLTF.Core.1.0.0-%VERSIONSUFFIX%.nupkg" --source "github"
rem dotnet nuget push "SharpGLTF.Toolkit/bin/Release/SharpGLTF.Toolkit.1.0.0-%VERSIONSUFFIX%.nupkg" --source "github"

nuget push "SharpGLTF.Core/bin/Release/SharpGLTF.Core.1.0.0-%VERSIONSUFFIX%.nupkg" -src "github"
nuget push "SharpGLTF.Toolkit/bin/Release/SharpGLTF.Toolkit.1.0.0-%VERSIONSUFFIX%.nupkg" -src "github"
rem nuget push "SharpGLTF.Core/bin/Release/SharpGLTF.Core.1.0.0-%VERSIONSUFFIX%.nupkg" -src "github"
rem nuget push "SharpGLTF.Toolkit/bin/Release/SharpGLTF.Toolkit.1.0.0-%VERSIONSUFFIX%.nupkg" -src "github"

pause

0 comments on commit b0385fd

Please sign in to comment.