修改yml

This commit is contained in:
2025-03-28 15:03:07 +08:00
parent c45114b7dd
commit 209f560682

View File

@@ -5,37 +5,8 @@ before_script:
stages:
- install
- lint
- build
- deploy
### 配置缓存
cache:
key:
files:
- package.json
- packages/ghost-weapp-ui/package.json
paths:
- node_modules/
- packages/ghost-weapp-ui/node_modules/
### 直接缓存.npm.npm中缓存了所有依赖因为gitlab缓存是分项目的所以两种方法个人觉得没有什么区别
# - .npm/
# eslint检测
job_lint:
only:
- master
stage: lint
before_script:
- echo 'eslint检测'
- ls -a
script:
- cd packages/ghost-weapp-ui
- ls -a
- yarn lint
- echo 'eslint检测完成'
retry: 0
when: 'on_success'
# 安装依赖
job_install:
@@ -45,31 +16,12 @@ job_install:
before_script:
- echo '安装依赖'
script:
- yarn config set registry https://registry.npm.taobao.org/
- yarn install
- cd packages/ghost-weapp-ui
- ls -a
- yarn install
- ls -a
- echo '依赖安装完成'
- cd Assets/02.InformationSave
- echo " registry=http://192.168.31.100:8418/api/packages/unity-registry/npm" > .npmrc
- echo "//192.168.31.100:8418/api/packages/unity-registry/:_authToken=7a502f73368672741accbd12fdf268909b1dca0f" >> .npmrc
retry: 0
# 打包编译
job_build:
only:
- master
stage: build
before_script:
- echo '开始打包'
script:
- cd packages/ghost-weapp-ui
- ls -a
- yarn
- ls -a
- yarn build
- echo '构建完成'
when: 'on_success'
retry: 0
# 发布
job_deploy:
@@ -77,12 +29,14 @@ job_deploy:
- master
stage: deploy
before_script:
- echo '更新补丁版本,准备发布'
- echo '开始发布'
script:
- cd packages/ghost-weapp-ui
- node deploy.js ${CI_COMMIT_REF_NAME}
- cd Assets/02.InformationSave
- npm publish
- echo '构建完成'
when: 'on_success'
retry: 0
after_script:
- echo "====== 发布完成 ========="