Skip to content

Commit

Permalink
fix(ci): env can not be in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo committed Dec 31, 2018
1 parent 0f7b07f commit 0e9eca2
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ release_branches: &release_branches
- dev
- next

release: &release
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: release
command: |
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
jobs:
# --------------------------------------------------------------------------
# Phase 1: Setup
Expand Down Expand Up @@ -112,25 +132,15 @@ jobs:
# --------------------------------------------------------------------------
# Phase 4: Release (dev branch only)
# --------------------------------------------------------------------------
release:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: release
command: |
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
release-commit:
<<: *release
environment:
COMMIT_MSG: '[release]'

This comment has been minimized.

Copy link
@pi0

pi0 Dec 31, 2018

Member

@clarkdo This should be swapped with release-nightly :)

This comment has been minimized.

Copy link
@clarkdo

clarkdo Dec 31, 2018

Author Member

Oops, sorry

This comment has been minimized.

Copy link
@clarkdo

clarkdo Dec 31, 2018

Author Member

@pi0 Done, thanks for the reminding


release-nightly:
<<: *release
environment:
COMMIT_MSG: $(git log --format=oneline -n 1 $CIRCLE_SHA1)

# Workflow definition
workflows:
Expand All @@ -146,12 +156,10 @@ workflows:
- build: { requires: [setup] }
- test-unit: { requires: [build] }
- test-e2e: { requires: [build] }
- release:
- release-commit:
requires: [build, lint, audit, test-unit, test-e2e]
filters:
<<: *release_branches
environment:
COMMIT_MSG: $(git log --format=oneline -n 1 $CIRCLE_SHA1)

# Release nightly builds on release branches
nightly:
Expand All @@ -162,10 +170,8 @@ workflows:
- build: { requires: [setup] }
- test-unit: { requires: [build] }
- test-e2e: { requires: [build] }
- release:
- release-nightly:
requires: [build, lint, audit, test-unit, test-e2e]
environment:
COMMIT_MSG: '[release]'
triggers:
- schedule:
cron: "0 0 * * *"
Expand Down

0 comments on commit 0e9eca2

Please sign in to comment.