Skip to content

Commit a0c7424

Browse files
authored
Manage releases using changesets (#625)
* chore(deps-dev): add @changesets/cli * chore: yarn changeset init * chore: update changeset.config.access to public * chore: add changesets/action to publish new version * chore: rename call-build to call-test * fix: remove setting yarn using corepack
1 parent af78edc commit a0c7424

File tree

7 files changed

+606
-14
lines changed

7 files changed

+606
-14
lines changed

.changeset/README.md

+8
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

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

.github/workflows/pull_request.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: pull_request
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
call-test:
9+
uses: ./.github/workflows/test.yml

.github/workflows/push.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: push
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
call-test:
9+
uses: ./.github/workflows/test.yml
10+
release:
11+
needs: call-test
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
id-token: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
cache: yarn
22+
23+
- run: yarn
24+
25+
- name: Create Release Pull Request or Publish to npm
26+
id: changesets
27+
uses: changesets/action@v1
28+
with:
29+
publish: yarn release
30+
title: Publish <version>
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: test
22

33
on:
44
workflow_call:
5-
pull_request:
6-
branches: [main]
7-
push:
8-
branches: [main]
95

106
jobs:
117
build:
@@ -16,9 +12,9 @@ jobs:
1612
node-version: [16.x, 18.x, 20.x]
1713

1814
steps:
19-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
2016
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
2218
with:
2319
node-version: ${{ matrix.node-version }}
2420
cache: yarn

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"scripts": {
1212
"clean": "rm -rf dist/",
1313
"prepare": "yarn clean && cp -R src/ dist/",
14-
"test": "jest --bail"
14+
"test": "jest --bail",
15+
"release": "changeset publish"
1516
},
1617
"bin": {
1718
"jscodeshift": "./bin/jscodeshift.js"
@@ -53,6 +54,7 @@
5354
},
5455
"devDependencies": {
5556
"@babel/eslint-parser": "^7.24.7",
57+
"@changesets/cli": "^2.27.8",
5658
"eslint": "8.56.0",
5759
"jest": "^29.7.0",
5860
"jsdoc": "^4.0.3"

0 commit comments

Comments
 (0)