Skip to content

Commit 0b361d0

Browse files
committed
fix
1 parent 61e322c commit 0b361d0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
${{ runner.os }}-bun-
3535
3636
- name: Install dependencies
37-
run: bun install
37+
run: bun install --frozen-lockfile
3838

3939
- name: Compile the assets
4040
run: bun compile
@@ -44,19 +44,17 @@ jobs:
4444
bun examples/basic.ts
4545
bun examples/oop.ts
4646
47-
- name: Replace version in package.json
48-
run: |
49-
VERSION=${GITHUB_REF#refs/tags/}
50-
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/g" package.json
47+
- id: current-version
48+
name: Get current version
49+
run: echo "CURRENT_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
5150

52-
- run: bun publish --provenance --access public
51+
- name: Set package version
52+
run: bunx npm version --no-git-tag-version $CURRENT_VERSION
5353
env:
54-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54+
CURRENT_VERSION: ${{ steps.current-version.outputs.CURRENT_VERSION }}
5555

56-
- name: Push version changes to GitHub
57-
run: |
58-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
59-
git config --global user.name "github-actions[bot]"
60-
git add .
61-
git commit -m "chore: update "
62-
git push origin main
56+
- run: |
57+
echo "//registry.npmjs.org/:_authToken=$AUTH_TOKEN" >> .npmrc
58+
bun publish --provenance --access=public
59+
env:
60+
AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)