File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ cli:npm:publish:
143143 set -euo pipefail
144144 : "${NPM_TOKEN:?NPM_TOKEN is required to publish}"
145145
146- # Tags should look like: cli-v0.14.0-beta.1
146+ # Tags should look like: cli-v0.14.0-dev.1 (or cli-v0.14.0- beta.1)
147147 case "${CI_COMMIT_TAG:-}" in
148148 cli-v*) ;;
149149 *) echo "Not a CLI publish tag, skipping"; exit 1 ;;
@@ -153,6 +153,12 @@ cli:npm:publish:
153153
154154 PKG_VERSION="$(node -p "require('./package.json').version")"
155155 TAG_VERSION="${CI_COMMIT_TAG#cli-v}"
156+ DIST_TAG="$(printf '%s' "$TAG_VERSION" | sed -E 's/^.*-(dev|beta)\\.[0-9]+$/\\1/')"
157+
158+ if [ "$DIST_TAG" != "dev" ] && [ "$DIST_TAG" != "beta" ]; then
159+ echo "Unsupported prerelease channel in tag/version: $TAG_VERSION (expected -dev.N or -beta.N)"
160+ exit 1
161+ fi
156162
157163 if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
158164 echo "Version mismatch: cli/package.json=$PKG_VERSION but tag=$TAG_VERSION"
@@ -164,11 +170,11 @@ cli:npm:publish:
164170
165171 npm ci --no-audit --no-fund
166172 npm run build
167- npm publish --tag beta --access public
173+ npm publish --tag "$DIST_TAG" --access public
168174 after_script :
169175 - rm -f ~/.npmrc
170176 rules :
171- - if : ' $CI_COMMIT_TAG =~ /^cli-v\\d+\\.\\d+\\.\\d+-beta\\.\\d+$/'
177+ - if : ' $CI_COMMIT_TAG =~ /^cli-v\\d+\\.\\d+\\.\\d+-(dev| beta) \\.\\d+$/'
172178
173179cli:node:e2e:dind :
174180 stage : test
Original file line number Diff line number Diff line change 11{
22 "name" : " postgresai" ,
3- "version" : " 0.14.0-beta .1" ,
3+ "version" : " 0.14.0-dev .1" ,
44 "description" : " postgres_ai CLI (Node.js)" ,
55 "license" : " Apache-2.0" ,
66 "private" : false ,
You can’t perform that action at this time.
0 commit comments