Skip to content

Commit 4d2c7ab

Browse files
committed
ci: add github action
1 parent f14329b commit 4d2c7ab

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

.github/workflows/next.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Next
2+
3+
on:
4+
push:
5+
branches:
6+
- "next"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup Node.js environment
16+
uses: actions/[email protected]
17+
18+
- name: Install yarn
19+
run: npm install -g yarn
20+
21+
- name: Install Dependencies
22+
run: yarn
23+
24+
- name: Run test
25+
run: yarn test
26+
27+
- name: Build and publish
28+
run: |
29+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
30+
yarn build
31+
yarn publish --tag=next --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup Node.js environment
16+
uses: actions/[email protected]
17+
18+
- name: Install yarn
19+
run: npm install -g yarn
20+
21+
- name: Install Dependencies
22+
run: yarn
23+
24+
- name: Run test
25+
run: yarn test
26+
27+
- name: Build and publish
28+
run: |
29+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
30+
yarn build
31+
yarn publish --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Setup Node.js environment
19+
uses: actions/[email protected]
20+
21+
- name: Install yarn
22+
run: npm install -g yarn
23+
24+
- name: Install Dependencies
25+
run: yarn
26+
27+
- name: Run test
28+
run: yarn test

0 commit comments

Comments
 (0)