File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -15,11 +15,30 @@ jobs:
1515 cache : pnpm
1616 registry-url : " https://registry.npmjs.org"
1717 - run : pnpm install --frozen-lockfile
18- - uses : changesets/action@v1
19- with :
20- publish : pnpm release
21- version : pnpm changeset version
18+
19+ - name : Check if version is already published
20+ id : check
21+ run : |
22+ PKG_NAME=$(node -p "require('./package.json').name")
23+ PKG_VERSION=$(node -p "require('./package.json').version")
24+ if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null; then
25+ echo "published=true" >> "$GITHUB_OUTPUT"
26+ else
27+ echo "published=false" >> "$GITHUB_OUTPUT"
28+ fi
29+
30+ - name : Build and publish
31+ if : steps.check.outputs.published == 'false'
32+ run : pnpm release
2233 env :
23- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2434 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
2535 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
36+
37+ - name : Create GitHub release tag
38+ if : steps.check.outputs.published == 'false'
39+ run : |
40+ PKG_VERSION=$(node -p "require('./package.json').version")
41+ git tag "v${PKG_VERSION}"
42+ git push origin "v${PKG_VERSION}"
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 3636 "test:exports" : " publint && attw --pack ." ,
3737 "lint" : " eslint ." ,
3838 "format:check" : " prettier --check ." ,
39- "release" : " pnpm build && changeset publish" ,
39+ "release" : " pnpm build && npm publish" ,
4040 "prepare" : " husky || true"
4141 },
4242 "lint-staged" : {
4545 },
4646 "devDependencies" : {
4747 "@arethetypeswrong/cli" : " ^0.17.3" ,
48- "@changesets/cli" : " ^2.29.4" ,
4948 "@commitlint/cli" : " ^19.8.1" ,
5049 "@commitlint/config-conventional" : " ^19.8.0" ,
5150 "@eslint/js" : " ^9.30.0" ,
You can’t perform that action at this time.
0 commit comments