Skip to content

Commit

Permalink
chore: automatic publication
Browse files Browse the repository at this point in the history
Add `.circleci` config
Remove `.travis.yml` config
Change badge
Populate `.npmignore`
Remove `npmpub`, add `standard-version` devDependencies
Adjust npm scripts
  • Loading branch information
medfreeman committed Jan 1, 2019
1 parent 2e5b246 commit 82b0faf
Show file tree
Hide file tree
Showing 6 changed files with 662 additions and 279 deletions.
96 changes: 96 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
version: 2

defaults: &defaults
working_directory: /usr/src/app
docker:
- image: node:10

jobs:
build-job:
<<: *defaults
steps:
# Checkout repository
- checkout

# Restore cache
- restore_cache:
key: yarn-{{ checksum "yarn.lock" }}

# Disable yarn progress bar for perf
- run:
command: yarn config set no-progress

# Disable yarn engine compatibility errors
- run:
command: yarn config set ignore-engines true

# Greenkeeper-lockfile
- run:
name: Installing Greenkeeper-lockfile
command: yarn global add greenkeeper-lockfile@1

# Install dependencies
- run:
name: Installing Dependencies
command: yarn

# Keep cache
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
paths:
- "node_modules"

# Update yarn.lock
- run:
name: Updating lockfile
command: greenkeeper-lockfile-update

# Test
- run:
name: Testing
command: yarn test-with-coverage

# Build
- run:
name: Uploading test coverage
command: yarn coverage

# Upload yarn.lock
- run:
name: Uploading lockfile
command: greenkeeper-lockfile-upload

- persist_to_workspace:
root: /usr/src/app
paths:
- dist/*
- .circleci/*

deploy-job:
<<: *defaults
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: /usr/src/app

- run:
name: Authenticating with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc

- run:
name: Publishing package
command: npm publish

workflows:
version: 2
build:
jobs:
- build-job
- deploy-job:
requires:
- build-job
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.*
*.yml
src/
.nyc_output/
coverage/
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# markdown-it-toc-and-anchor
[![Travis Build Status](https://img.shields.io/travis/medfreeman/markdown-it-toc-and-anchor.svg?label=unix%20build)](https://travis-ci.org/medfreeman/markdown-it-toc-and-anchor)
[![circleci](https://badgen.net/circleci/github/medfreeman/markdown-it-toc-and-anchor/master)](https://circleci.com/gh/medfreeman/markdown-it-toc-and-anchor)
[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/medfreeman/markdown-it-toc-and-anchor.svg?label=windows%20build)](https://ci.appveyor.com/project/medfreeman/markdown-it-toc-and-anchor)
[![Version](https://img.shields.io/npm/v/markdown-it-toc-and-anchor.svg)](https://github.com/medfreeman/markdown-it-toc-and-anchor/blob/master/CHANGELOG.md)
[![Coverage Status](https://img.shields.io/coveralls/medfreeman/markdown-it-toc-and-anchor/master.svg)](https://coveralls.io/github/medfreeman/markdown-it-toc-and-anchor?branch=master)
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@
"eslint-config-i-am-meticulous": "^11.0.0",
"eslint-plugin-import": "^2.2.0",
"markdown-it": "^8.2.2",
"npmpub": "^4.1.0",
"nyc": "^13.1.0"
"nyc": "^13.1.0",
"standard-version": "^4.4.0"
},
"scripts": {
"prepublish": "babel src --ignore \"src/__tests__/**/*.js\" --out-dir dist --delete-dir-on-start",
"lint": "eslint --ignore-path .gitignore --fix .",
"tests": "ava",
"pretest": "npm -s run lint",
"test": "npm -s run tests",
"test-with-coverage": "nyc npm run test",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "npmpub"
"build": "babel src --ignore \"src/__tests__/**/*.js\" --out-dir dist --delete-dir-on-start",
"release": "standard-version; git push --follow-tags",
"prepare": "yarn build"
},
"babel": {
"presets": [
Expand Down

0 comments on commit 82b0faf

Please sign in to comment.