From e38676415145d05cf9ab3961b194ae978456109b Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Thu, 30 Oct 2025 14:08:48 +0100 Subject: [PATCH] npm publish fix --- workflow-templates/build-npm-pro.yaml | 39 ++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/workflow-templates/build-npm-pro.yaml b/workflow-templates/build-npm-pro.yaml index 09110cd31..ddd73729f 100644 --- a/workflow-templates/build-npm-pro.yaml +++ b/workflow-templates/build-npm-pro.yaml @@ -8,6 +8,10 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+' - 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+' +permissions: + id-token: write + contents: write + # on: # push: # branches: @@ -43,13 +47,17 @@ jobs: cd dbgate-merged node adjustNpmPackageJsonPremium - - name: Configure NPM token - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - cd .. - cd dbgate-merged - npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + # - name: Configure NPM token + # env: + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # run: | + # cd .. + # cd dbgate-merged + # npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + + # Ensure npm 11.5.1 or later is installed + - name: Update npm + run: npm install -g npm@latest - name: Remove dbmodel - should be not published run: | @@ -69,33 +77,40 @@ jobs: cd dbgate-merged yarn setCurrentVersion + - name: Compute npm dist-tag + run: | + if [[ "${GITHUB_REF_NAME}" =~ -alpha\. ]]; then + echo "NPM_TAG=alpha" >> $GITHUB_ENV + else + echo "NPM_TAG=latest" >> $GITHUB_ENV + fi - name: Publish dbgate-api-premium run: | cd .. cd dbgate-merged/packages/api - npm publish + npm publish --tag "$NPM_TAG" - name: Publish dbgate-web-premium run: | cd .. cd dbgate-merged/packages/web - npm publish + npm publish --tag "$NPM_TAG" - name: Publish dbgate-serve-premium run: | cd .. cd dbgate-merged/packages/serve - npm publish + npm publish --tag "$NPM_TAG" - name: Publish dbgate-plugin-cosmosdb run: | cd .. cd dbgate-merged/plugins/dbgate-plugin-cosmosdb - npm publish + npm publish --tag "$NPM_TAG" - name: Publish dbgate-plugin-firestore run: | cd .. cd dbgate-merged/plugins/dbgate-plugin-firestore - npm publish + npm publish --tag "$NPM_TAG"