Skip to content

Commit

Permalink
chore: semantic-release and circleci
Browse files Browse the repository at this point in the history
This will move packages to CircleCI. It also adds a "publish" job that will publish the package according to Semantic Release.
  • Loading branch information
ForbesLindesay committed Oct 11, 2019
1 parent cc57e8b commit a468fdb
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 24 deletions.
105 changes: 105 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
version: 2.1

workflows:
test:
jobs:
- unit-tests:
<<: *not_master
version: 8
- unit-tests:
<<: *not_master
version: 10
- unit-tests:
<<: *not_master
version: 12

release:
jobs:
- unit-tests:
<<: *only_master
name: v8
version: 8
- unit-tests:
<<: *only_master
name: v10
version: 10
- unit-tests:
<<: *only_master
name: v12
version: 12

- publish:
<<: *only_master
context: master
requires:
- v8
- v10
- v12

monthly:
triggers:
- schedule:
cron: '0 0 1 * *'
<<: *only_master
jobs:
- unit-tests:
version: 8
- unit-tests:
version: 10
- unit-tests:
version: 12
jobs:
unit-tests:
parameters:
version:
type: string
docker:
- image: circleci/node:<< parameters.version >>
steps:
- setup
- test

publish:
docker:
- image: circleci/node:12
steps:
- setup
- publish

commands:
setup:
description: "Checkout and install dependencies"
steps:
- run:
name: Versions
command: node -v && npm -v && yarn -v
- run:
name: Install Dependencies
command: yarn install --pure-lockfile

test:
steps:
- run:
name: Test
command: yarn test

publish:
steps:
- run:
name: NPM Auth
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Release
command: npx semantic-release

refs:
- &only_master
filters:
branches:
only: master

- &not_master
filters:
branches:
ignore: master

14 changes: 14 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Config for https://github.com/probot/semantic-pull-requests

# Always validate the PR title, and ignore the commits
titleOnly: true
types:
# To do a major relase, put "BREAKING CHANGE: ..." in the message
# Minor Release
- feat
# Patch Release
- fix
- perf
# No Release
- docs
- chore
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions HISTORY.md

This file was deleted.

21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use JSTransformer Boilerplate to create and update transformers.

[Foo](http://example.com) support for [JSTransformers](http://github.com/jstransformers).

[![Build Status](https://img.shields.io/travis/jstransformers/jstransformer-foo/master.svg)](https://travis-ci.org/jstransformers/jstransformer-foo)
[![Build Status](https://img.shields.io/circleci/build/github/jstransformers/jstransformer-foo/master)](https://circleci.com/gh/jstransformers/jstransformer-foo/tree/master)
[![Coverage Status](https://img.shields.io/codecov/c/github/jstransformers/jstransformer-foo/master.svg)](https://codecov.io/gh/jstransformers/jstransformer-foo)
[![Dependency Status](https://img.shields.io/david/jstransformers/jstransformer-foo/master.svg)](http://david-dm.org/jstransformers/jstransformer-foo)
[![Greenkeeper badge](https://badges.greenkeeper.io/jstransformers/jstransformer-foo.svg)](https://greenkeeper.io/)
Expand All @@ -28,6 +28,25 @@ foo.render('blah').body
//=> 'blah'
```

## Development

Please feel free to submit pull requests for any feature requests, bug fixes etc.

To test your code locally:

- `yarn install` - install dependencies
- `yarn test` - runs tests

Your PR title should begin with:

- `feat: ` - if your change requires a minor release, because it introduces new feature
- `fix: ` - if your change requires a patch release, because it fixes a bug
- `perf: ` - if your change requires a patch release, because it improves performance
- `docs: ` - if you have made no code changes, and no release is required.
- `chore: ` - if you have changed some config/dependencies/CI, but no release is required.

If your PR includes a breaking change, the body of a commit in your PR should include: `BREAKING CHANGE: a description of what change was made`.

## License

MIT
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jstransformer-foo",
"version": "0.0.0",
"private": true,
"description": "Foo support for JSTransformers.",
"keywords": [
"jstransformer"
Expand All @@ -17,7 +17,7 @@
"posttest": "xo --space=2 --no-semicolon index.js"
},
"engines": {
"node": ">=4"
"node": ">=8"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit a468fdb

Please sign in to comment.