Skip to content

Commit 82b0faf

Browse files
committed
chore: automatic publication
Add `.circleci` config Remove `.travis.yml` config Change badge Populate `.npmignore` Remove `npmpub`, add `standard-version` devDependencies Adjust npm scripts
1 parent 2e5b246 commit 82b0faf

File tree

6 files changed

+662
-279
lines changed

6 files changed

+662
-279
lines changed

.circleci/config.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
working_directory: /usr/src/app
5+
docker:
6+
- image: node:10
7+
8+
jobs:
9+
build-job:
10+
<<: *defaults
11+
steps:
12+
# Checkout repository
13+
- checkout
14+
15+
# Restore cache
16+
- restore_cache:
17+
key: yarn-{{ checksum "yarn.lock" }}
18+
19+
# Disable yarn progress bar for perf
20+
- run:
21+
command: yarn config set no-progress
22+
23+
# Disable yarn engine compatibility errors
24+
- run:
25+
command: yarn config set ignore-engines true
26+
27+
# Greenkeeper-lockfile
28+
- run:
29+
name: Installing Greenkeeper-lockfile
30+
command: yarn global add greenkeeper-lockfile@1
31+
32+
# Install dependencies
33+
- run:
34+
name: Installing Dependencies
35+
command: yarn
36+
37+
# Keep cache
38+
- save_cache:
39+
key: yarn-{{ checksum "yarn.lock" }}
40+
paths:
41+
- "node_modules"
42+
43+
# Update yarn.lock
44+
- run:
45+
name: Updating lockfile
46+
command: greenkeeper-lockfile-update
47+
48+
# Test
49+
- run:
50+
name: Testing
51+
command: yarn test-with-coverage
52+
53+
# Build
54+
- run:
55+
name: Uploading test coverage
56+
command: yarn coverage
57+
58+
# Upload yarn.lock
59+
- run:
60+
name: Uploading lockfile
61+
command: greenkeeper-lockfile-upload
62+
63+
- persist_to_workspace:
64+
root: /usr/src/app
65+
paths:
66+
- dist/*
67+
- .circleci/*
68+
69+
deploy-job:
70+
<<: *defaults
71+
steps:
72+
- attach_workspace:
73+
# Must be absolute path or relative path from working_directory
74+
at: /usr/src/app
75+
76+
- run:
77+
name: Authenticating with registry
78+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
79+
80+
- run:
81+
name: Publishing package
82+
command: npm publish
83+
84+
workflows:
85+
version: 2
86+
build:
87+
jobs:
88+
- build-job
89+
- deploy-job:
90+
requires:
91+
- build-job
92+
filters:
93+
tags:
94+
only: /^v.*/
95+
branches:
96+
ignore: /.*/

.npmignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.*
2+
*.yml
3+
src/
4+
.nyc_output/
5+
coverage/

.travis.yml

-22
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# markdown-it-toc-and-anchor
2-
[![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)
2+
[![circleci](https://badgen.net/circleci/github/medfreeman/markdown-it-toc-and-anchor/master)](https://circleci.com/gh/medfreeman/markdown-it-toc-and-anchor)
33
[![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)
44
[![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)
55
[![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)

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@
3333
"eslint-config-i-am-meticulous": "^11.0.0",
3434
"eslint-plugin-import": "^2.2.0",
3535
"markdown-it": "^8.2.2",
36-
"npmpub": "^4.1.0",
37-
"nyc": "^13.1.0"
36+
"nyc": "^13.1.0",
37+
"standard-version": "^4.4.0"
3838
},
3939
"scripts": {
40-
"prepublish": "babel src --ignore \"src/__tests__/**/*.js\" --out-dir dist --delete-dir-on-start",
4140
"lint": "eslint --ignore-path .gitignore --fix .",
4241
"tests": "ava",
4342
"pretest": "npm -s run lint",
4443
"test": "npm -s run tests",
4544
"test-with-coverage": "nyc npm run test",
4645
"coverage": "nyc report --reporter=text-lcov | coveralls",
47-
"release": "npmpub"
46+
"build": "babel src --ignore \"src/__tests__/**/*.js\" --out-dir dist --delete-dir-on-start",
47+
"release": "standard-version; git push --follow-tags",
48+
"prepare": "yarn build"
4849
},
4950
"babel": {
5051
"presets": [

0 commit comments

Comments
 (0)