Skip to content

Commit 3ffe895

Browse files
authored
Publishing and changelog workflow (#96)
* introduce changestes * add contributing info * fix config
1 parent 124802d commit 3ffe895

File tree

7 files changed

+615
-17
lines changed

7 files changed

+615
-17
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/main/docs/common-questions.md)

.changeset/config.json

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

.github/workflows/release.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node.js 16.x
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 16
22+
23+
- name: Install
24+
run: yarn --frozen-lockfile
25+
26+
- name: Create Release Pull Request
27+
uses: changesets/action@master
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ To verify setup, run the Storybook with `yarn storybook`. You can develop new o
2727
Run all unit tests with `yarn test`. Run unit tests on only the package you're working on with `yarn test packages/<PACKAGE_NAME_HERE>`.
2828

2929
We use `husky` for pre-commit hooks to verify files are properly linted prior to committing. This will run automatically whenever adding or amending a commit.
30+
31+
## Creating a pull request
32+
33+
When you create a pull request a `changeset-bot` will tell you that you need to create a changeset, if your change has an effect on the published packages
34+
all you need to do is run `yarn changeset` at the root. This will ask you whether your change is a patch (fixes a bug), a minor (adds a feature) or a major (breaking change)
35+
select the one that applies and describe the change you did. This is used to automate our changelogging.

CONTRIBUTING_ON_WINDOWS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ Below are some helpful resources.
3232
* Follow the the instructions found in the [CONTRIBUTING](/CONTRIBUTING.md) readme.
3333
* If you run into 'EACCESS' permissions issues:
3434
* double check your directory permissions with `ls -la`
35-
* If the owner is root, you may have problems when running `yarn install`. You can modify the permissions with the following command `sudo chown -R [yourUsername] [yourProjectDir]`. The `-R` is to recurse into each of the files and directories.
35+
* If the owner is root, you may have problems when running `yarn install`. You can modify the permissions with the following command `sudo chown -R [yourUsername] [yourProjectDir]`. The `-R` is to recurse into each of the files and directories.
36+
37+
## Creating a pull request
38+
39+
When you create a pull request a `changeset-bot` will tell you that you need to create a changeset, if your change has an effect on the published packages
40+
all you need to do is run `yarn changeset` at the root. This will ask you whether your change is a patch (fixes a bug), a minor (adds a feature) or a major (breaking change)
41+
select the one that applies and describe the change you did. This is used to automate our changelogging.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@
2626
"postinstall": "preconstruct dev",
2727
"example": "yarn workspace example dev",
2828
"build-storybook": "build-storybook",
29-
"chromatic": "chromatic --exit-zero-on-changes"
29+
"chromatic": "chromatic --exit-zero-on-changes",
30+
"publish": "yarn changeset publish"
3031
},
3132
"devDependencies": {
3233
"@babel/cli": "^7.16.0",
3334
"@babel/core": "^7.16.0",
3435
"@babel/preset-env": "^7.16.4",
3536
"@babel/preset-react": "^7.16.0",
3637
"@babel/preset-typescript": "^7.16.0",
38+
"@changesets/changelog-github": "^0.4.2",
39+
"@changesets/cli": "^2.18.1",
3740
"@preconstruct/cli": "^2.1.5",
3841
"@testing-library/jest-dom": "^5.15.1",
3942
"@testing-library/react": "^12.1.2",

0 commit comments

Comments
 (0)