From 0f7b07f8c1122f4d501d848f0500cdd1d4c8931a Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Sun, 30 Dec 2018 17:29:56 +0000 Subject: [PATCH] chore(ci): use release text instead of manually approval (#4660) --- .circleci/config.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e03e361fd..ed635c26c9 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -121,12 +121,16 @@ jobs: - run: name: release command: | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - yarn lerna version --yes --no-git-tag-version --no-push - PACKAGE_SUFFIX=edge yarn build - if [ "$CIRCLE_BRANCH" = "next" ]; then tag="--tag next"; fi - ./scripts/workspace-run npm publish $tag -q + if echo "$COMMIT_MSG" | grep -o "\[release\]"; then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc + yarn lerna version --yes --no-git-tag-version --no-push + PACKAGE_SUFFIX=edge yarn build + if [ "$CIRCLE_BRANCH" = "next" ]; then tag="--tag next"; fi + ./scripts/workspace-run npm publish $tag -q + else + echo "Release phase is skipped." + fi # Workflow definition workflows: @@ -142,16 +146,12 @@ workflows: - build: { requires: [setup] } - test-unit: { requires: [build] } - test-e2e: { requires: [build] } - - release-approval: - type: approval + - release: requires: [build, lint, audit, test-unit, test-e2e] filters: <<: *release_branches - - release: - requires: - - release-approval - filters: - <<: *release_branches + environment: + COMMIT_MSG: $(git log --format=oneline -n 1 $CIRCLE_SHA1) # Release nightly builds on release branches nightly: @@ -162,7 +162,10 @@ workflows: - build: { requires: [setup] } - test-unit: { requires: [build] } - test-e2e: { requires: [build] } - - release: { requires: [build, lint, audit, test-unit, test-e2e] } + - release: + requires: [build, lint, audit, test-unit, test-e2e] + environment: + COMMIT_MSG: '[release]' triggers: - schedule: cron: "0 0 * * *"