@@ -125,11 +125,86 @@ jobs:
125125 NPM_ORG_TOKEN : ${{ secrets.NPM_ORG_TOKEN }}
126126 SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
127127
128+ # Publish SDK packages to the `next` npm dist-tag — internal dev/QA use only, never
129+ # date-lockstep-shaped, never recommended to customers (see issue #36701). Kept as its
130+ # own job (not folded into cicd_comp_deployment-phase.yml) so this trunk-only concern
131+ # can't affect nightly/manual/release, which don't opt into it.
132+ #
133+ # Version = the currently-published `latest` npm version, plus a `-next.<run_number>`
134+ # suffix — computed live on every run, no local VERSION file. Gated on the existing
135+ # sdk_libs change-detection filter (only publish when SDK files actually changed) and
136+ # skipped for manual workflow_dispatch runs.
137+ publish-sdk-next :
138+ name : Publish SDK (next)
139+ needs : [ initialize, test ]
140+ # Explicit success check on `test` (not the always()/!failure() idiom used by
141+ # sibling jobs) — this job publishes to a real, public npm registry, so it should
142+ # require `test` to have actually run and passed, not merely "didn't fail/wasn't
143+ # cancelled" (which also admits a skipped test job).
144+ if : >-
145+ needs.test.result == 'success' &&
146+ fromJSON(needs.initialize.outputs.filters).sdk_libs == 'true' &&
147+ github.event_name != 'workflow_dispatch'
148+ runs-on : ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }}
149+ steps :
150+ - name : ' Compute next version'
151+ id : next-version
152+ env :
153+ NPM_AUTH_TOKEN : ${{ secrets.NPM_ORG_TOKEN }}
154+ run : |
155+ set -euo pipefail
156+ echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
157+
158+ LATEST_VERSION=$(npm view @dotcms/client version)
159+ NEXT_VERSION="${LATEST_VERSION}-next.${{ github.run_number }}"
160+
161+ echo "::notice:: Currently published latest version: $LATEST_VERSION"
162+ echo "::notice:: Publishing next version: $NEXT_VERSION"
163+
164+ echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
165+
166+ - name : ' Publish SDK packages to NPM (next)'
167+ id : deploy-javascript-sdk
168+ uses : ./.github/actions/core-cicd/deployment/deploy-javascript-sdk
169+ with :
170+ ref : ${{ github.sha }}
171+ version : ${{ steps.next-version.outputs.version }}
172+ npm-tag : next
173+ npm-token : ${{ secrets.NPM_ORG_TOKEN }}
174+ github-token : ${{ secrets.GITHUB_TOKEN }}
175+
176+ - name : ' Slack Notification (SDK next announcement)'
177+ if : success() && steps.deploy-javascript-sdk.outputs.published == 'true'
178+ continue-on-error : true
179+ uses : ./.github/actions/core-cicd/notification/notify-slack
180+ with :
181+ channel-id : " log-sdk-libs"
182+ payload : |
183+ > :large_orange_circle: *Attention dotters:* SDK libs published to `next`!
184+ >
185+ > This automated script is happy to announce that a new *_SDK libs_* version *tagged as:* [ `${{ steps.next-version.outputs.version }}` ] is now available on the `NPM` registry under the `next` tag :package:. This is an internal dev/QA build, not an official release — do not recommend it to customers.
186+ > `npm install @dotcms/client@next`
187+ > <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|View commit> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>
188+ slack-bot-token : ${{ secrets.SLACK_BOT_TOKEN }}
189+
190+ - name : ' Slack Notification (SDK next failure)'
191+ if : failure()
192+ continue-on-error : true
193+ uses : ./.github/actions/core-cicd/notification/notify-slack
194+ with :
195+ channel-id : " log-sdk-libs"
196+ payload : |
197+ > :red_circle: *SDK `next` publish FAILED!*
198+ >
199+ > The automated SDK `next` publish failed while trying to publish version `${{ steps.next-version.outputs.version }}`.
200+ > <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|View commit> · <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run — check logs for details>
201+ slack-bot-token : ${{ secrets.SLACK_BOT_TOKEN }}
202+
128203 # Finalize job - aggregates results from previous jobs
129204 finalize :
130205 name : Finalize
131206 if : always()
132- needs : [ initialize, build, build-cli, test, deployment]
207+ needs : [ initialize, build, build-cli, test, deployment, publish-sdk-next ]
133208 uses : ./.github/workflows/cicd_comp_finalize-phase.yml
134209 with :
135210 artifact-run-id : ${{ needs.initialize.outputs.artifact-run-id }}
0 commit comments