Skip to content

Commit d2458fc

Browse files
committed
feat: add github action
1 parent 1ce1e8d commit d2458fc

File tree

5 files changed

+4343
-925
lines changed

5 files changed

+4343
-925
lines changed

.github/workflows/npm-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish NPM
2+
on:
3+
create:
4+
tags:
5+
- v*
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
# Setup .npmrc file to publish to npm
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '12.x'
15+
registry-url: 'https://registry.npmjs.org'
16+
- run: npm ci
17+
- run: make build
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
level?=patch
2+
13
# Development
24
lint:
35
@echo "Linting..."
@@ -27,4 +29,10 @@ build-demo:
2729
@echo "Building demo..."
2830
@rm -rf ./demo/dist
2931
@NODE_ENV=production npx rollup -c ./demo/rollup.config.js
30-
.PHONY: build build-demo
32+
release:
33+
@echo "Release $(level)"
34+
@echo "Adding tag and modify the CHANGELOG"
35+
@npx standard-version --release-as $(level)
36+
@echo "Pushing to the github and trigger action for npm:publish"
37+
@git push --follow-tags origin master
38+
.PHONY: build build-demo release

0 commit comments

Comments
 (0)