diff --git a/Dockerfile b/Dockerfile index dae34067..c64f1b05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ COPY . ./ # Write version info ARG VERSION ENV VERSION=${VERSION} -RUN sed -i -r "s/\"version\": \"([^+]+).*\",$/\"version\": \"\\1+neko:${VERSION}\",/" package.json +RUN pnpm pkg set version="${VERSION}" # Compile RUN env NODE_ENV=production sh -c "pnpm run --filter '!native-utils' build && pnpm run gulp" diff --git a/neko/update/native.sh b/neko/update/native.sh index 80cfe4fd..78dcf127 100755 --- a/neko/update/native.sh +++ b/neko/update/native.sh @@ -24,10 +24,7 @@ fi # write version info say 'Writing version info to package.json...' -run "$(cat - << EOC -sed "s/\"version\": \"\([^+][^+]*\).*\",$/\"version\": \"\\1+neko:$(version)\",/" package.json > package.json.new && mv -- package.json.new package.json -EOC -)" +run "pnpm pkg set version=$(version)" say 'Done!' br diff --git a/neko/update/utils b/neko/update/utils index ad36922e..0c17a88a 100644 --- a/neko/update/utils +++ b/neko/update/utils @@ -22,7 +22,8 @@ br() { } version() { + UPSTREAM_VERSION=$(pnpm pkg get version | sed -e 's/"//g') COMMIT_DATE=$(git show --no-patch --pretty='%cs' FETCH_HEAD | sed -e 's/-//g' | cut -c 3-) COMMIT_HASH_INITIAL=$(printf '%s' "$(git rev-parse FETCH_HEAD)" | cut -c 1) - printf '%s.%s' "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}" + printf '%s+neko:%s.%s' "${UPSTREAM_VERSION}" "${COMMIT_DATE}" "${COMMIT_HASH_INITIAL}" }