Skip to content

Commit a05662c

Browse files
committed
ci: fix release [skip-ci]
1 parent b04ef8a commit a05662c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
git config user.name "${GITHUB_ACTOR}"
4646
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
4747
48+
- name: Set NPM Config
49+
run: npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
50+
env:
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
4853
- name: Bump Version
4954
run: |
5055
npm version ${{ github.event.inputs.bump }} -m "chore: bump version"
@@ -54,8 +59,6 @@ jobs:
5459

5560
- name: Publish
5661
run: npm publish --provenance --access public
57-
env:
58-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5962

6063
- name: Commit
6164
run: git push --follow-tags

scripts/release.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ console.log(`Bump Type: ${bump}`);
6161

6262
const nextVersion = version
6363
.split(".")
64-
.map((v, i) => (i === BUMP_TYPES.indexOf(bump) ? String(Number(v) + 1) : v))
64+
.map((v, i) =>
65+
i === BUMP_TYPES.indexOf(bump)
66+
? String(Number(v) + 1)
67+
: i > BUMP_TYPES.indexOf(bump)
68+
? "0"
69+
: v,
70+
)
6571
.join(".");
6672

6773
console.log(`Next Version: ${nextVersion}`);

0 commit comments

Comments
 (0)