Skip to content

Commit 0de266a

Browse files
Merge branch 'master' into v2-beta
2 parents 42a137d + db46c2b commit 0de266a

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

.github/workflows/npm-publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
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+
- run: npm ci --ignore-scripts
16+
- run: npm test
17+
18+
publish-npm:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-node@v2
24+
with:
25+
node-version: 14
26+
registry-url: https://registry.npmjs.org/
27+
- run: npm ci --ignore-scripts
28+
- run: npm run build
29+
- run: echo "tag=latest" >> $GITHUB_ENV
30+
- name: Sets npm tag
31+
if: contains(github.event.release.tag_name, 'beta')
32+
run: echo "tag=beta" >> $GITHUB_ENV
33+
- run: npm publish --access public --tag {{ env.tag }}
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
36+
37+
publish-github:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
42+
packages: write
43+
steps:
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-node@v2
46+
with:
47+
node-version: 14
48+
registry-url: https://npm.pkg.github.com/
49+
- run: npm ci --ignore-scripts
50+
- run: npm run build
51+
- run: echo "tag=latest" >> $GITHUB_ENV
52+
- name: Sets npm tag
53+
if: contains(github.event.release.tag_name, 'beta')
54+
run: echo "tag=beta" >> $GITHUB_ENV
55+
- run: npm publish --tag {{ env.tag }}
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040
"dist/src/**/*"
4141
],
4242
"scripts": {
43-
"prepack": "npm i && tsc",
4443
"test": "tsc --sourceMap && ava",
45-
"build": "tsc"
44+
"build": "rm -rf dist && tsc"
4645
},
4746
"dependencies": {},
4847
"devDependencies": {

0 commit comments

Comments
 (0)