Skip to content

Commit f15b99d

Browse files
authored
Use changesets for automatic publishing (#22)
1 parent e643d70 commit f15b99d

File tree

8 files changed

+651
-1273
lines changed

8 files changed

+651
-1273
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"linked": [],
6+
"access": "public",
7+
"baseBranch": "master",
8+
"updateInternalDependencies": "patch",
9+
"ignore": []
10+
}

.changeset/four-pans-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-use-clipboard": patch
3+
---
4+
5+
Use changesets for automatic publishing

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Create release PR or publish to NPM
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
with:
15+
# Fetch all Git history so that Changesets can generate changelogs
16+
# with the correct commits
17+
fetch-depth: 0
18+
- name: Use Node.js 12.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
- name: Restore Yarn cache
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
node_modules
27+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
28+
- name: Install dependencies
29+
run: |
30+
yarn install --frozen-lockfile
31+
- name: Create release PR or publish to NPM
32+
uses: changesets/action@master
33+
with:
34+
publish: yarn release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
uses: actions/setup-node@v1
1313
with:
1414
node-version: 12.x
15+
- name: Restore Yarn cache
16+
uses: actions/cache@v2
17+
with:
18+
path: |
19+
node_modules
20+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
1521
- name: Install dependencies
1622
run: |
1723
yarn install --frozen-lockfile
@@ -27,6 +33,12 @@ jobs:
2733
uses: actions/setup-node@v1
2834
with:
2935
node-version: 12.x
36+
- name: Restore Yarn cache
37+
uses: actions/cache@v2
38+
with:
39+
path: |
40+
node_modules
41+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
3042
- name: Install dependencies
3143
run: |
3244
yarn install --frozen-lockfile
@@ -42,6 +54,12 @@ jobs:
4254
uses: actions/setup-node@v1
4355
with:
4456
node-version: 12.x
57+
- name: Restore Yarn cache
58+
uses: actions/cache@v2
59+
with:
60+
path: |
61+
node_modules
62+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4563
- name: Install dependencies
4664
run: |
4765
yarn install --frozen-lockfile

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CHANGELOG.md
12
yarn.lock
23
dist
34
.git

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@
2929
"@babel/preset-env": "^7.12.1",
3030
"@babel/preset-react": "^7.12.1",
3131
"@babel/preset-typescript": "^7.12.1",
32+
"@changesets/cli": "^2.12.0",
3233
"@testing-library/react": "^11.1.0",
3334
"@types/jest": "^26.0.15",
3435
"@types/react": "^16.9.55",
3536
"@types/react-dom": "^16.9.9",
3637
"babel-core": "^7.0.0-bridge.0",
3738
"babel-jest": "^26.6.1",
3839
"babel-loader": "^8.1.0",
39-
"husky": "^4.3.0",
4040
"jest": "^26.6.1",
4141
"microbundle": "0.11.0",
42-
"np": "^7.0.0",
4342
"prettier": "2.1.2",
44-
"pretty-quick": "^3.1.0",
4543
"react": "^17.0.1",
4644
"react-dom": "^17.0.1",
4745
"tslint": "^6.1.3",
@@ -69,10 +67,5 @@
6967
"clipboard",
7068
"hooks"
7169
],
72-
"homepage": "https://github.com/danoc/react-use-clipboard#readme",
73-
"husky": {
74-
"hooks": {
75-
"pre-commit": "pretty-quick --staged"
76-
}
77-
}
70+
"homepage": "https://github.com/danoc/react-use-clipboard#readme"
7871
}

0 commit comments

Comments
 (0)