mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
Fix releasing as latest on npm, but not within changeset (#643)
This commit is contained in:
@@ -48,6 +48,22 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
|
||||
|
||||
- name: Add latest dist-tag to published packages
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
|
||||
run: |
|
||||
# Configure npm auth for dist-tag operations
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
|
||||
# Parse published packages and add latest tag to each
|
||||
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -c '.[]' | while read -r pkg; do
|
||||
NAME=$(echo "$pkg" | jq -r '.name')
|
||||
VERSION=$(echo "$pkg" | jq -r '.version')
|
||||
echo "Adding 'latest' dist-tag to ${NAME}@${VERSION}..."
|
||||
npm dist-tag add "${NAME}@${VERSION}" latest || echo "Failed to add dist-tag for ${NAME}, continuing..."
|
||||
done
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
env:
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
"format": "biome format --write",
|
||||
"changeset": "changeset",
|
||||
"ci:version": "changeset version",
|
||||
"ci:publish": "pnpm build && changeset publish --tag latest",
|
||||
"ci:publish": "pnpm build && changeset publish",
|
||||
"release:notes": "node scripts/generate-release-notes.mjs"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
Reference in New Issue
Block a user