Skip to content

Commit

Permalink
fix: trying to fix the travis-ci script
Browse files Browse the repository at this point in the history
Trying to make semantic-release to work in this project.

fix #1
  • Loading branch information
Ziv-Barber committed Oct 8, 2018
1 parent a6c899f commit 2cd58b6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_js: 8
branches:
only:
- master
before_script:
- npm prune
deploy:
provider: script
skip_cleanup: true
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Rollup based javascript library boilerplate + babel 7, eslint, flow, jest, esdoc
[![coverage lines](./coverage/badge-lines.svg)](https://github.com/pamepeixinho/jest-coverage-badges)
[![coverage functions](./coverage/badge-functions.svg)](https://github.com/pamepeixinho/jest-coverage-badges)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![build status](https://travis-ci.org/undefined/library-boilerplate.svg?branch=master)](https://travis-ci.org/undefined/library-boilerplate)

![library-boilerplate logo](https://cdn-images-1.medium.com/max/1500/1*LQbS9RgHy93y9JH8ltejuQ.jpeg)

Expand All @@ -30,18 +31,9 @@ Start with cloning the project:
$ git clone --depth=1 git://github.com/Ziv-Barber/library-boilerplate.git your-project-name
```

Then:

- Remove the .git directory.
- Edit package.json:
- Change the name of the project to your project name.
- Change the version to 0.1.0
- If you want to release a npm package then change:
"release": "npx run-s test release:pre"
to:
"release": "npx run-s test release:pre release:publish"

The boilerplate without any changes supporting creating a library for both CommonJS, es6 modules, amd and browser. If you don't need all of this then just edit the rollup.config.js file and remove the inputs that you don't need.
- Remove the .git directory (rm -rf your-project-name/.git).
- Edit package.json and change the name of the project to your project name.
- The boilerplate without any changes supporting creating a library for both CommonJS, es6 modules, amd and browser. If you don't need all of this then just edit the rollup.config.js file and remove the inputs that you don't need.

Now, create a new github project and do:

Expand All @@ -59,9 +51,25 @@ This project is using [semantic-release](https://github.com/semantic-release/sem
- Select your new project and click setting.
- You MUST configure a token or [semantic-release](https://github.com/semantic-release/semantic-release) will not be able to commit changes:
- Create a new token (see [here](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) how to do it).
- Permissions needed in the github token:
- repo:
- repo:status
- repo_deployment
- public_repo
- admin:org:
- read:org
- admin:repo_hook:
- write:repo_hook
- user:
- user:email
- In your Travis-CI project setting, go to the environment settings section and add a new environment variable with the name 'GH_TOKEN' and the generated token as the data.
- To test everything just push something into github and it should update everything automatic!

Allow doing npm publish automatically by [semantic-release](https://github.com/semantic-release/semantic-release):

- You need a npm token (see [here](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens)) and add it as the NPM_TOKEN environment variable to Travis-CI like you did with the GH_TOKEN for github.
- Update the release section in package.json and add '@semantic-release/npm' to both 'publishConfig' and 'verifyConditions'.

<a name="features"></a>
## Features: ##

Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "library-boilerplate",
"version": "0.1.0",
"version": "0.0.0-semantic-release",
"description": "Rollup based javascript library boilerplate + babel 7, eslint, flow, jest, esdoc and live editing.",
"scripts": {
"start": "better-npm-run start",
Expand All @@ -17,9 +17,8 @@
"dev:watch": "npx rollup -c --environment BUILD:development -w",
"esdoc": "npx esdoc",
"lint": "better-npm-run lint",
"release": "npx run-s test release:pre",
"release:pre": "npx semantic-release",
"release:publish": "npm publish"
"release": "npx run-s test release:sr",
"release:sr": "npx semantic-release"
},
"keywords": [
"boilerplate",
Expand Down Expand Up @@ -106,5 +105,13 @@
"NODE_ENV": "development"
}
}
},
"release": {
"publishConfig": [
"@semantic-release/github"
],
"verifyConditions": [
"@semantic-release/github"
]
}
}

0 comments on commit 2cd58b6

Please sign in to comment.