Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ git:
branches:
only:
- develop
- "/^feature\\/.*$/"
- "/^fix\\/.*$/"
- master
- "/^feature\/.*$/"
- "/^feat\/.*$/"
- "/^fix\/.*$/"
jobs:
include:
- stage: "Fundamental-react: Lint"
Expand All @@ -20,3 +22,11 @@ notifications:
email:
on_failure: always
on_success: change
before_deploy:
- bash ./ci-scripts/setup_npm.sh
deploy:
- provider: script
script: bash ./ci-scripts/publish.sh $TRAVIS_BRANCH $TRAVIS_BUILD_NUMBER
on:
branch: master
skip_cleanup: true
23 changes: 23 additions & 0 deletions ci-scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /bin/bash
git config --global user.email "travis@travisci.org"
git config --global user.name "travis"

git checkout master
npm install
npm run build

# update the package verion and commit to the git repository
npm run std-version

# pushes changes to master
git push --quiet --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" "$TRAVIS_BRANCH" > /dev/null 2>&1;

# commit changes made by standard-version to develop branch
git checkout develop
git merge master
git commit -a -m "chore: merge master into develop [ci skip]"
git push --quiet --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" develop > /dev/null 2>&1;

# publish master to npm
git checkout master
npm publish
9 changes: 9 additions & 0 deletions ci-scripts/setup_npm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -o nounset
set -o errexit

echo "//registry.npmjs.org/:username=${NPM_USERNAME}" >> ~/.npmrc
echo "//registry.npmjs.org/:email=${NPM_EMAIL}" >> ~/.npmrc
echo "//registry.npmjs.org/:_password=${NPM_PASSWORD}" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${AUTH_TOKEN}" >> ~/.npmrc
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"predeploy": "npm run build",
"start-js": "node scripts/start.js",
"start": "node scripts/start.js",
"std-version": "standard-version -m \"chore(release): version %s build ${TRAVIS_BUILD_NUMBER} [ci skip]\"",
"test:coverage": "jest --coverage",
"test:dev": "jest",
"test": "node scripts/test.js",
Expand Down