-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-pre-release.bat
47 lines (36 loc) · 1.13 KB
/
build-pre-release.bat
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
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
set FIND=C:\Windows\System32\find.exe
set SUFFIX=%1
FOR /F "tokens=4,* USEBACKQ" %%G IN (`npx standard-version --dry-run ^| %FIND% "tagging"`) DO SET PRE_RELEASE_VERSION=%%G
if "%1"=="" (
set SUFFIX=alpha
)
WHERE npm >nul 2>&1
set NPM_AVAILABLE=%ERRORLEVEL%
:build
call npm install
call npm run build
IF "%ERRORLEVEL%" NEQ "0" (
ECHO The npm build failed with return code %ERRORLEVEL%.
exit /B %ERRORLEVEL%
)
GOTO end
REM Check that the version of standard-version supports dry-run
call standard-version --help | %FIND% "dry-run" 1> nul 2> nul
IF "%ERRORLEVEL%" NEQ "0" (
GOTO :standardVersionError
)
:build
ECHO Building Prelease Version: %PRE_RELEASE_VERSION%-%SUFFIX%
call yarn
REM call yarn run setVersionSuffix %SUFFIX%
REM call yarn run build:pre-release
set "PreReleaseVersion=%PRE_RELEASE_VERSION%" & set "VersionSuffix=%SUFFIX%" & yarn run build:pre-release
GOTO end
:error
ECHO Please run %~n0%~x0 again after installing yarn.
:standardVersionError
ECHO Please install the latest version of standard-version (see https://github.com/conventional-changelog/standard-version)
ECHO.
GOTO end
:end