ci: enable web release builds on LAN Drone runner
This commit is contained in:
1 parent
da8d332fac
commit
5b4be04645
2 files changed
+23
-4
No files matched your search
+22
-3
@@ -1,6 +1,5 @@
|
||||
# 仅 tag 触发:顺序打包 backend / mobile-h5
|
||||
# web 暂不在 CI 构建(测试机内存不足以跑 Vite 生产包),后续另议
|
||||
# 产物:/root/hzdyjs-releases/<tag>/{backend,mobile-h5}-<tag>.*
|
||||
# 仅 tag 触发:在内网 Runner 顺序打包 backend / mobile-h5 / web
|
||||
# 产物:/root/hzdyjs-releases/<tag>/{backend,mobile-h5,web}-<tag>.*
|
||||
# Maven 缓存:宿主机 /root/maven-repo → 容器 /maven-repo(由 runner DRONE_RUNNER_VOLUMES 注入)
|
||||
# 发版目录:/root/hzdyjs-releases → /hzdyjs-releases(同上,勿在本文件重复挂载)
|
||||
|
||||
@@ -55,3 +54,23 @@ steps:
|
||||
- tar -C dist/build/h5 -czf "/hzdyjs-releases/${DRONE_TAG}/mobile-h5-${DRONE_TAG}.tar.gz" .
|
||||
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/"
|
||||
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/mobile-h5-${DRONE_TAG}.tar.gz"
|
||||
|
||||
- name: package-web
|
||||
image: node:20-bookworm
|
||||
environment:
|
||||
NPM_CONFIG_REGISTRY: https://registry.npmmirror.com
|
||||
commands:
|
||||
- set -eu
|
||||
- echo "==> web tag=${DRONE_TAG} commit=${DRONE_COMMIT}"
|
||||
- test -n "${DRONE_TAG}"
|
||||
- mkdir -p "/hzdyjs-releases/${DRONE_TAG}"
|
||||
- cd web
|
||||
# 固定兼容 Node 20 的 npm 11,避开镜像内 npm 10 的 edgesOut 解析异常。
|
||||
- npm install --global npm@11.21.1 --no-audit --no-fund --registry https://registry.npmmirror.com
|
||||
- npm install --no-audit --no-fund --registry https://registry.npmmirror.com
|
||||
# build:ci 使用 6 GB Node 堆并限制 Vite 并行,避免与其他打包步骤叠加内存。
|
||||
- npm run build:ci
|
||||
- test -s dist/index.html
|
||||
- tar -C dist -czf "/hzdyjs-releases/${DRONE_TAG}/web-${DRONE_TAG}.tar.gz" .
|
||||
- ls -lh "/hzdyjs-releases/${DRONE_TAG}/web-${DRONE_TAG}.tar.gz"
|
||||
- sha256sum "/hzdyjs-releases/${DRONE_TAG}/web-${DRONE_TAG}.tar.gz"
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite serve --mode development",
|
||||
"build:prod": "node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode production",
|
||||
"build:ci": "CI=true VITE_LOW_MEM=1 VITE_BUILD_COMPRESS= node --max-old-space-size=5120 node_modules/vite/bin/vite.js build --mode production",
|
||||
"build:ci": "CI=true VITE_LOW_MEM=1 VITE_BUILD_COMPRESS= node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode production",
|
||||
"build:dev": "node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode development",
|
||||
"preview": "vite preview",
|
||||
"lint:eslint": "eslint",
|
||||
|
||||
Reference in new issue
Block a user