Skip to content

Commit d460a4f

Browse files
committed
chore: fix publish workflow
1 parent 2f19019 commit d460a4f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Prepare Environment
3939
run: |
4040
corepack enable
41-
yarn install
41+
yarn install --immutable
4242
env:
4343
CI: true
4444
- name: Run tests
@@ -89,9 +89,7 @@ jobs:
8989
9090
else
9191
# Otherwise (push by tag), keep the previous logic: compare published vs package.json
92-
PACKAGE_NAME=$(yarn info -s . name)
93-
PUBLISHED_VERSION=$(yarn info -s $PACKAGE_NAME version)
94-
# PUBLISHED_VERSION=$(yarn npm info --json . | jq -c '.version' -r) # yarn 3/4 alternative
92+
PUBLISHED_VERSION=$(yarn npm info --json . | jq -c '.version' -r)
9593
THIS_VERSION=$(node -p "require('./package.json').version")
9694
# Simple bash helper to compare version numbers
9795
verlte() {
@@ -116,8 +114,7 @@ jobs:
116114
# Bump to prerelease version if needed
117115
if [ "${{ steps.do-publish.outputs.prerelease }}" != "" ]; then
118116
OLD_VERSION=$(node -p "require('./package.json').version")
119-
yarn version --new-version ${OLD_VERSION}-${{ steps.do-publish.outputs.prerelease }} --no-git-tag-version
120-
# yarn version ${OLD_VERSION}-${{ steps.do-publish.outputs.prerelease }} # yarn 3/4 alternative
117+
yarn version ${OLD_VERSION}-${{ steps.do-publish.outputs.prerelease }}
121118
fi
122119
123120
yarn build
@@ -193,7 +190,7 @@ jobs:
193190
yarn install
194191
195192
# Publish from the extracted release (build output present)
196-
npm publish --access=public --provenance --tag ${{ needs.prepare.outputs.tag }}
193+
npm publish --ignore-scripts --access=public --provenance --tag ${{ needs.prepare.outputs.tag }}
197194
198195
NEW_VERSION=$(node -p "require('./package.json').version")
199196
echo "**Published:** $NEW_VERSION" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)