Skip to content

Commit 3645305

Browse files
authored
Merge pull request #53 from react-hook-form/setup-semantic-release
Setup semantic release
2 parents 7ac249b + efe73f3 commit 3645305

File tree

4 files changed

+104
-2043
lines changed

4 files changed

+104
-2043
lines changed

.github/workflows/main.yml

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,63 @@
11
name: CI
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- beta
7+
- 1.x
8+
pull_request:
9+
paths-ignore:
10+
- '.gitignore'
11+
- '.npmignore'
12+
- '*.md'
13+
314
jobs:
415
build:
16+
name: Lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
517
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
node-version: [12.x]
18+
919
steps:
10-
- uses: actions/checkout@v2
11-
- name: Use Node.js ${{ matrix.node-version }}
20+
- name: Checkout repo
21+
uses: actions/checkout@v2
22+
23+
- name: Use Node ${{ matrix.node }}
1224
uses: actions/setup-node@v1
1325
with:
14-
node-version: ${{ matrix.node-version }}
15-
- name: Install dependencies
16-
run: yarn install --frozen-lockfile
26+
node-version: ${{ matrix.node }}
27+
28+
- name: Install deps and build (with cache)
29+
uses: bahmutov/npm-install@v1
30+
1731
- name: Lint
1832
run: |
19-
npm run lint:types
20-
npm run lint
33+
yarn lint
34+
yarn lint:types
35+
2136
- name: Test
22-
run: npm test
23-
env:
24-
CI: true
37+
run: yarn test --ci
38+
2539
- name: Build
26-
run: npm run build
40+
run: yarn build
41+
42+
publish-module:
43+
name: 'Publish Module to NPM on Node ${{ matrix.node }} and ${{ matrix.os }}'
44+
needs: build
45+
if: github.repository == 'react-hook-form/resolvers' && (github.ref =='refs/heads/master' || github.ref == 'refs/heads/1.x')
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout repo
49+
uses: actions/checkout@v2
50+
- name: 'Use Node ${{ matrix.node }}'
51+
uses: actions/setup-node@v1
52+
with:
53+
node-version: '${{ matrix.node }}'
54+
registry-url: 'https://registry.npmjs.org/'
55+
- name: Install dependencies
56+
uses: bahmutov/npm-install@v1
57+
- name: Build
58+
run: yarn build
59+
- name: Publish
60+
run: npx semantic-release
61+
env:
62+
NODE_AUTH_TOKEN: '${{secrets.NPM_TOKEN}}'
63+
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'

.github/workflows/size.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: size
1+
name: Compressed Size
2+
23
on: [pull_request]
4+
35
jobs:
4-
size:
6+
build:
57
runs-on: ubuntu-latest
6-
env:
7-
CI_JOB_NUMBER: 1
8+
89
steps:
9-
- uses: actions/checkout@v1
10-
- uses: andresz1/size-limit-action@v1
10+
- uses: actions/checkout@v2
11+
- uses: preactjs/compressed-size-action@v2
1112
with:
12-
github_token: ${{ secrets.GITHUB_TOKEN }}
13+
repo-token: '${{ secrets.GITHUB_TOKEN }}'

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,10 @@
6666
},
6767
"homepage": "https://react-hook-form.com",
6868
"devDependencies": {
69-
"@size-limit/preset-small-lib": "^4.9.0",
7069
"@testing-library/react": "^11.2.2",
71-
"@testing-library/react-hooks": "^3.4.2",
7270
"@types/jest": "^26.0.15",
7371
"@types/react": "^17.0.0",
7472
"@types/react-dom": "^17.0.0",
75-
"@types/react-test-renderer": "^17.0.0",
7673
"@typescript-eslint/eslint-plugin": "^4.8.1",
7774
"@typescript-eslint/parser": "^4.8.1",
7875
"eslint": "^7.14.0",
@@ -88,9 +85,7 @@
8885
"react": "^17.0.1",
8986
"react-dom": "^17.0.1",
9087
"react-hook-form": "^6.11.4",
91-
"react-test-renderer": "^17.0.1",
9288
"rimraf": "^3.0.2",
93-
"size-limit": "^4.9.0",
9489
"ts-jest": "^26.4.4",
9590
"typescript": "^4.1.2"
9691
},

0 commit comments

Comments
 (0)