Skip to content

Commit

Permalink
chore: 修复编译脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Dec 15, 2023
1 parent a7fe414 commit e52365f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
::

::¼ÓÔØNode»·¾³
::����Node����

IF EXIST D:\RunTime\node\runtime.bat (
CALL D:\RunTime\node\runtime set "%~n0"
Expand All @@ -16,6 +16,7 @@ IF NOT EXIST node_modules (
npm install
)

npm run lint
npm run build

IF "%1" == "" CMD /K
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ set -o noglob

####################################################################

RUN_NUMBER=${GITHUB_RUN_NUMBER:-0}

last_tag=`git tag | sort -V | tail -n 1`
prev_tag=`git tag | sort -V | tail -n 2 | head -n 1`
git log $prev_tag..$last_tag --pretty=format:"%s" | grep -v "^release" | sed 's/^/- /' | sort > RELEASE.md

version=`echo $last_tag | sed 's/^v//'`
sed -i "s/^const Version = \".*\"/const Version = \"$version\"/" src/helper/const.ts

build_version=$((`grep -oP 'BuildVersion = "\K\d+' src/helper/const.ts` + ${GITHUB_RUN_NUMBER:-0}))
build_version=$((`grep -oP "BuildVersion = '\K\d+" src/helper/const.ts` + $RUN_NUMBER))
sed -i "s/^const BuildVersion = \".*\"/const BuildVersion = \"$build_version\"/" src/helper/const.ts

echo "build info - tag: $last_tag, version: $version, build: $build_version"
Expand Down

0 comments on commit e52365f

Please sign in to comment.