Skip to content

Commit

Permalink
Merge pull request #105 from iCHEF/feature/zhusee_revise_deploy
Browse files Browse the repository at this point in the history
Revise deploy steps
  • Loading branch information
zhusee2 authored Oct 26, 2017
2 parents 2e80dca + 5d9ba64 commit 56efd2c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
26 changes: 18 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,30 @@ install:
before_script:
- yarn flow
- yarn lint
- yarn test

script:
# Auth NPM for later release
- npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}
# Publish canary builds when feature merges back to develop
- "if [ ${TRAVIS_PULL_REQUEST} = 'false' ] && [ ${TRAVIS_BRANCH} = 'develop' ]; then yarn canary ; fi"
# Publish release builds when merges to master
- "if [ ${TRAVIS_PULL_REQUEST} = 'false' ] && [ ${TRAVIS_BRANCH} = 'master' ]; then sh ./scripts/deploy.sh ; fi"
- yarn test

# Send coverage data to Coveralls
after_script:
after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

before_deploy:
- npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}

deploy:
- provider: script
script: yarn canary
skip_cleanup: true
on:
branch: develop

- provider: script
script: yarn release && yarn ghpages
skip_cleanup: true
on:
branch: master

branches:
only:
- master
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,16 @@ Gypcrete does not publish develop builds to the `dist` branch anymore. It now pu
* When pushed to `develop` branch --> publish a canary build
* When pushed to `master` branch --> publish a relase build

### Releasing
When releasing a new build for Gypcrete, create a release branch `release/x.y.z` and bump version first by:
```sh
yarn bumpversion
```

This will run `lerna publish`, which updates all `package.json` files in `packages/`, commits the changes with pre-configured message and tags that commit.

Then create a pull request for this release branch.
Once it's merged into `master`, it should trigger `yarn release` and publishes packages to npm.

## LICENSE
This project is licensed under the terms of the [Apache License 2.0](https://github.com/ichef/gypcrete/blob/master/LICENSE)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"scripts": {
"prepublish": "lerna run prepublish",
"start": "lerna run storybook --stream",
"release": "lerna publish -m \"Lerna publish %s\" --yes --repo-version $PACKAGE_VERSION",
"bumpversion": "lerna publish -m \"Bump version to %s\" --skip-npm",
"release": "lerna publish --yes --repo-version $PACKAGE_VERSION --skip-git",
"canary": "lerna publish -c --yes",
"ghpages": "lerna run ghpages",
"lint": "npm run lint:eslint && npm run lint:stylelint",
Expand Down
10 changes: 0 additions & 10 deletions scripts/deploy.sh

This file was deleted.

0 comments on commit 56efd2c

Please sign in to comment.