Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: semantic-release and circleci #60

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
143 changes: 143 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
version: 2.1

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

- &not_master
filters:
branches:
ignore: master

workflows:
test:
jobs:
- unit-tests:
<<: *not_master
name: node-8
version: "8"
- unit-tests:
<<: *not_master
name: node-10
version: "10"
- unit-tests:
<<: *not_master
name: node-12
version: "12"
- unit-tests:
<<: *not_master
name: node-13
version: "13"

release:
jobs:
- unit-tests:
<<: *only_master
name: node-8
version: "8"
- unit-tests:
<<: *only_master
name: node-10
version: "10"
- unit-tests:
<<: *only_master
name: node-12
version: "12"
- unit-tests:
<<: *not_master
name: node-13
version: "13"

- publish-dry-run:
<<: *only_master
context: master

- publish-approval:
type: approval
context: master
requires:
- publish-dry-run

- publish:
<<: *only_master
context: master
requires:
- node-8
- node-10
- node-12
- publish-approval

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

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

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

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

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

publish-dry-run:
steps:
- run:
name: Release (Dry Run)
command: npx semantic-release --dry-run

publish:
steps:
- run:
name: NPM Auth
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Release
command: npx semantic-release
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
15 changes: 0 additions & 15 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:

- `npm install` - install dependencies
- `npm 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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call... We'll have to remember to remove private from the packages that use this. 👍

"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