Skip to content

Commit 1cd64ed

Browse files
committed
Publish by CI
- readme fixes - npm publish ci config added
1 parent 94d6855 commit 1cd64ed

File tree

3 files changed

+44
-11
lines changed

3 files changed

+44
-11
lines changed

.github/workflows/npm-publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Node.js package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
registry-url: https://registry.npmjs.org/
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Lint
21+
run: |
22+
npm run lint
23+
npm run type-check
24+
25+
- name: Build package
26+
run: |
27+
npm --no-git-tag-version version ${GITHUB_REF#refs/*/}
28+
npm run build
29+
30+
- name: Publish build
31+
run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/tests.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v2
15-
with:
16-
node-version: 14
17-
- run: npm ci
18-
- run: npm run lint
19-
- run: npm run test --if-present
20-
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
- run: npm ci
18+
- run: npm run lint
19+
- run: npm run type-check
20+
- run: npm run test --if-present

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ yarn add middleware-axios
1919
Wrap axios instance (interface will be saved):
2020

2121
```js
22-
import { create } from 'middleware-axios';
22+
import { create } from 'middleware-axios/dist';
2323

2424
// create wrapped instance in the same way as normal axios instance
2525
const api = create({

0 commit comments

Comments
 (0)