Skip to content

Commit

Permalink
ci(release): Set up semantic-release (#6)
Browse files Browse the repository at this point in the history
Commit workflow, contribution guide and readme badges are also included.

BREAKING CHANGE: Not really, just want to start on v1.0
  • Loading branch information
markdalgleish committed Apr 6, 2017
1 parent f8c196a commit b6cacae
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 7 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- '7'
- '6'
before_script:
- npm prune
after_success:
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing to sku

⚠️ 🌏 👀 First and foremost, remember that this repo is **open source**.

Don't post anything or commit any code that isn't ready for the entire world to see. Avoid making specific reference to internal processes or features under development. While a lot of this information is probably harmless, it's better to be safe than sorry.

If you work at SEEK and run into issues along the way, or even if you find some of these steps confusing or intimidating, please reach out to your friendly neighbourhood developer in the sku development Slack channel. We'll be super excited to help out!

## Setup

First, install [Node.js v6+](https://nodejs.org/).

After cloning the project, install the dependencies:

```bash
$ npm install
```

## Workflow

Before starting your work, first ensure you're in the `master` branch and that you've pulled down the latest changes:

```bash
$ git checkout master
$ git pull
```

Next, create a new branch for your work, with an appropriate name for your change:

```bash
$ git checkout -b add-my-cool-new-feature
```

To run the test suite locally:

```bash
$ npm test
```

Note that the test suite needs to pass for your changes to be accepted, so it's worth running this locally during development and before committing.

Once you've made the desired changes and you're ready to commit, stage your local changes, being careful to exclude irrelevant changes.

## Semantic Release

Before committing, consider the scope of your changes according to [semantic versioning](http://semver.org), noting whether this is a breaking change, a feature release or a patch.

New versions are published automatically from [Travis CI](https://travis-ci.org) using [semantic-release](https://github.com/semantic-release/semantic-release). In order to automatically increment version numbers correctly, commit messages must follow our [semantic commit message convention](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). If your commit includes a breaking change, be sure to prefix your commit body with `BREAKING CHANGE: `. To make this process easier, we have a commit script (powered by [commitizen](https://github.com/commitizen/cz-cli)) to help guide you through the commit process:

```bash
$ npm run commit
```

Once you've committed your work, push your changes to an upstream branch of the same name, and create a new pull request from your branch.

In order for your pull request to be accepted, the [Travis CI](https://travis-ci.org) build needs to pass, and another contributor needs to approve your work. It's likely that you might need to make some changes for your work to be accepted, but don't take this personally! Ultimately, the aim is to make it feel like the codebase was written by a single person, but this takes a lot of work and constant review of each others' work.

Once your work is approved and ready to go, hit the merge button and check that your commit message and description are clean and free of cruft, removing any irrelevant messages due to review feedback. [When editing your squashed commit, don't forget that your commit message affects the final published version number.](#semantic-release)

Finally, take a deep breath, hit the green "confirm" button, and we have liftoff—your work should be automatically deployed!

🎨📦🚀
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://img.shields.io/travis/seek-oss/sku/master.svg?style=flat-square)](http://travis-ci.org/seek-oss/sku)
[![Build Status](https://img.shields.io/travis/seek-oss/sku/master.svg?style=flat-square)](http://travis-ci.org/seek-oss/sku) [![npm](https://img.shields.io/npm/v/sku.svg?style=flat-square)](https://www.npmjs.com/package/sku) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/) [![Styled with Prettier](https://img.shields.io/badge/styled%20with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

# sku

Expand Down Expand Up @@ -191,6 +191,10 @@ You can then start the relevant project by name at development time:
$ npm start hello
```

## Contributing

Refer to [CONTRIBUTING.md](./CONTRIBUTING.md).

## License

MIT License
24 changes: 18 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sku",
"version": "0.0.6",
"version": "0.0.0-development",
"description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
"main": "index.js",
"bin": {
Expand All @@ -10,17 +10,25 @@
"test": "npm run format-check",
"format": "prettier --single-quote --write '{bin,config,scripts}/**/*.js'",
"format-check": "prettier --single-quote --list-different '{bin,config,scripts}/**/*.js'",
"precommit": "lint-staged"
"precommit": "lint-staged",
"commit": "git-cz",
"commitmsg": "validate-commit-msg",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"lint-staged": {
"*.js": [
"prettier --single-quote --write",
"git add"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/SEEK-Jobs/sku.git"
"url": "https://github.com/seek-oss/sku.git"
},
"keywords": [
"toolkit",
Expand All @@ -29,9 +37,9 @@
"author": "SEEK",
"license": "MIT",
"bugs": {
"url": "https://github.com/SEEK-Jobs/sku/issues"
"url": "https://github.com/seek-oss/sku/issues"
},
"homepage": "https://github.com/SEEK-Jobs/sku#readme",
"homepage": "https://github.com/seek-oss/sku#readme",
"dependencies": {
"autoprefixer": "^6.7.7",
"babel-core": "^6.22.1",
Expand Down Expand Up @@ -73,8 +81,12 @@
"webpack-dev-server": "^2.3.0"
},
"devDependencies": {
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"husky": "^0.13.3",
"lint-staged": "^3.4.0",
"prettier": "^0.22.0"
"prettier": "^0.22.0",
"semantic-release": "^6.3.2",
"validate-commit-msg": "^2.12.1"
}
}

0 comments on commit b6cacae

Please sign in to comment.