🌐 AI搜索 & 代理 主页
Skip to content

Commit 0652adc

Browse files
Nik SamokhvalovNik Samokhvalov
authored andcommitted
ci: derive cli npm version from tag
- Use npm version --no-git-tag-version in publish job - Remove requirement for cli/package.json version to match tag
1 parent 30a8af2 commit 0652adc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ cli:npm:publish:
157157
158158
cd cli
159159
160-
PKG_VERSION="$(node -p "require('./package.json').version")"
161160
TAG_VERSION="$RAW_TAG"
162161
TAG_VERSION="${TAG_VERSION#v}"
163162
@@ -173,15 +172,12 @@ cli:npm:publish:
173172
exit 1
174173
fi
175174
176-
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
177-
echo "Version mismatch: cli/package.json=$PKG_VERSION but tag=$TAG_VERSION"
178-
exit 1
179-
fi
180-
181175
# Configure npm auth without committing credentials
182176
printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" > ~/.npmrc
183177
184178
npm ci --no-audit --no-fund
179+
# Make the git tag the source of truth without committing version bumps.
180+
npm version --no-git-tag-version "$TAG_VERSION"
185181
npm run build
186182
npm publish --tag "$DIST_TAG" --access public
187183
after_script:

0 commit comments

Comments
 (0)