Skip to content

Commit 10a00fd

Browse files
committed
Merge remote-tracking branch 'origin/v0.0.3-beta.4'
2 parents b758869 + 03e433f commit 10a00fd

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ jobs:
2323
git config user.name '${{secrets.MAINTAINER_NAME}}'
2424
git config user.email '${{secrets.MAINTAINER_EMAIL}}'
2525
26+
- name: Update package.json
27+
run: |
28+
# Extract the version from the git tag (e.g., "v1.0.0")
29+
version=$(echo "${{ github.ref }}" | sed -e 's/^refs\/tags\/v//')
30+
31+
# Update the package.json version using Node.js script
32+
node - <<EOF
33+
const fs = require('fs');
34+
const packageJson = JSON.parse(fs.readFileSync('package.json'));
35+
packageJson.version = "$version";
36+
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
37+
EOF
38+
2639
- uses: pnpm/action-setup@v2
2740
name: Install pnpm
2841
id: pnpm-install
@@ -50,6 +63,8 @@ jobs:
5063
- name: Build nextjs pages
5164
run: pnpm run build
5265

66+
67+
5368
- name: Publish
5469
run: |
5570
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
"dependencies": {
4444
"unbuild": "^1.2.1"
4545
}
46-
}
46+
}

0 commit comments

Comments
 (0)