Skip to content

Commit 3847d0f

Browse files
committed
Update release-to-npm.yml
1 parent eb5e88b commit 3847d0f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/release-to-npm.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66

77
permissions:
8-
contents: write # Allow pushing changes to the repository
8+
contents: write
99

1010
jobs:
1111
release:
@@ -16,7 +16,7 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v3
1818

19-
# Step 2: Set up Node.js without caching
19+
# Step 2: Set up Node.js
2020
- name: Set up Node.js
2121
uses: actions/setup-node@v3
2222
with:
@@ -26,20 +26,21 @@ jobs:
2626
- name: Clear npm cache
2727
run: npm cache clean --force
2828

29-
# Step 4: Install dependencies (without lock file)
29+
# Step 4: Install dependencies
3030
- name: Install dependencies
3131
run: npm install --no-package-lock
3232

3333
# Step 5: Sync package.json version with release tag
3434
- name: Sync version with release tag
3535
run: |
3636
RELEASE_VERSION=${GITHUB_REF#refs/tags/}
37-
echo "Updating package.json to version ${RELEASE_VERSION}"
38-
npm version ${RELEASE_VERSION} --no-git-tag-version
37+
echo "Updating package.json to match release version ${RELEASE_VERSION}"
38+
jq ".version = \"${RELEASE_VERSION}\"" package.json > temp.json && mv temp.json package.json
39+
cat package.json # Debugging output to ensure version is updated
3940
4041
# Step 6: Generate/update changelog
4142
- name: Update changelog
42-
run: npx standard-version --skip.tag --skip.commit
43+
run: npx standard-version --skip.bump --skip.tag --skip.commit
4344

4445
# Step 7: Authenticate with npm
4546
- name: Authenticate with npm

0 commit comments

Comments
 (0)