-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.bat
More file actions
53 lines (39 loc) · 787 Bytes
/
publish.bat
File metadata and controls
53 lines (39 loc) · 787 Bytes
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
47
48
49
50
51
52
53
@echo off
IF [%1] == [] GOTO HELP
set ver=%1
git status
setlocal
echo.
echo ### CHECK YOUR WORKSPACE IS EMPTY ###
echo.
SET /P CHOICE=Publish version %ver%? (Y/N)
IF /I "%CHOICE%" NEQ "Y" GOTO END
echo.
echo Building...
call npm run build || GOTO FAILED
echo Setting version...
call npm version %ver% --no-git-tag-version --allow-same-version || GOTO FAILED
echo Publishing to npm...
call npm publish || GOTO FAILED
echo.
SET /P CHOICE=Push tags (Y/[N])?
IF /I "%CHOICE%" NEQ "Y" GOTO END
echo.
echo Pushing tag...
git tag -a %ver% -m %ver% || GOTO FAILED
git push origin %ver% || GOTO FAILED
echo.
echo Complete.
echo.
ECHO Now clear your workspace: git reset --hard
GOTO END
:HELP
echo.
echo USAGE: publish 1.2.3
GOTO END
:FAILED
echo.
echo FAILED
GOTO END
:END
endlocal