Skip to content

Commit 341db25

Browse files
authored
Merge pull request #3 from JSerFeng/feat/github-action
feat: publish using changeset
2 parents 4d32e57 + 21b9a6a commit 341db25

File tree

6 files changed

+846
-7
lines changed

6 files changed

+846
-7
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/empty-spiders-spend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"dep-tracer": patch
3+
---
4+
5+
resolve dep even missing in dependencies for initial lookup

.github/workflows/publish.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish
22

3-
on:
4-
workflow_dispatch:
3+
permissions:
4+
contents: write
55

66
jobs:
77
publish:
@@ -17,7 +17,23 @@ jobs:
1717
registry-url: 'https://registry.npmjs.org'
1818
cache: 'pnpm'
1919
- run: pnpm install
20-
- run: pnpm run build
21-
- run: pnpm publish --no-git-checks
20+
21+
- name: Git config
22+
run: |
23+
git config --global user.name "github-actions[bot]"
24+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
25+
26+
- name: Version
27+
run: pnpm exec changeset version
28+
29+
- name: Build
30+
run: pnpm run build
31+
32+
- name: Publish
33+
run: pnpm exec changeset publish
2234
env:
2335
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
37+
- name: Push changes
38+
run: |
39+
git push origin main --follow-tags

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
"scripts": {
1414
"build": "tsc",
1515
"prepublishOnly": "npm run build",
16-
"test": "rstest"
16+
"test": "rstest",
17+
"changeset": "changeset",
18+
"version": "changeset version",
19+
"release": "npm run build && changeset publish"
1720
},
1821
"keywords": [],
1922
"author": "jserfeng",
@@ -22,7 +25,8 @@
2225
"enhanced-resolve": "^5.12.0"
2326
},
2427
"devDependencies": {
25-
"@types/node": "^18.13.0",
26-
"@rstest/core": "latest"
28+
"@changesets/cli": "^2.29.8",
29+
"@rstest/core": "latest",
30+
"@types/node": "^18.13.0"
2731
}
2832
}

0 commit comments

Comments
 (0)