尝试让travis跳过PR /非主分支构建的发布阶段,但我似乎无法使配方正确。
列出了travis配置here:
language: node_js
cache:
directories:
- node_modules
node_js:
- '8'
- '6'
before_install:
- npm install -g npm@5
- npm install -g greenkeeper-lockfile@1
install:
- yarn install --ignore-engines
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
script:
- yarn coveralls
branches:
except:
- /^v\d+\.\d+\.\d+$/
jobs:
include:
- if: branch = master
- stage: release
node_js: lts/*
script: echo "Deploying to npm ..."
deploy:
provider: script
skip_cleanup: true
script:
- npx semantic-release
我也试过
jobs:
include:
- stage: release
if: branch = master
node_js: lts/*
script: echo "Deploying to npm ..."
deploy:
provider: script
skip_cleanup: true
script:
- npx semantic-release
和
jobs:
include:
-
if: branch = master
- stage: release
node_js: lts/*
script: echo "Deploying to npm ..."
deploy:
provider: script
skip_cleanup: true
script:
- npx semantic-release
但travis总是执行发布阶段 - 它不会运行npx semantic-release
但它仍然会进行初始化,运行测试等。