name: Publish current branch to npm on: workflow_dispatch: push: branches: - main jobs: publish: runs-on: ubuntu-latest permissions: contents: read id-token: write # npm trusted publishing authenticates with an OIDC token instead of a secret strategy: fail-fast: false # one package failing must not cancel the others mid-publish matrix: package: [ ., packages/confluent-kafka-receive, packages/create, packages/dbos-cloud, packages/drizzle-datasource, packages/kafkajs-receive, packages/knex-datasource, packages/kysely-datasource, packages/nodepg-datasource, packages/postgres-datasource, packages/prisma-datasource, packages/typeorm-datasource, packages/otel, ] steps: - name: Checkout uses: actions/checkout@v4.1.1 with: fetch-depth: 0 # the version is derived from tags and commit history fetch-tags: true - name: Use Node.js 24 uses: actions/setup-node@v4.0.2 with: node-version: 24 registry-url: https://registry.npmjs.org - name: Update npm # trusted publishing needs npm 11.5.1 or later run: npm install -g npm@latest - name: Compute version id: version run: node publish/version.mjs - run: npm ci; npm run build - name: Stamp version run: npm pkg set version=${{ steps.version.outputs.version }} working-directory: ${{ matrix.package }} - name: Stamp enterprise peer range if: matrix.package == '.' run: | range=$(node publish/peer_range.mjs) npm pkg set "peerDependencies.@dbos-inc/dbos-enterprise=$range" - run: npm run build working-directory: ${{ matrix.package }} - name: Publish ${{ steps.version.outputs.version }} to npm as ${{ steps.version.outputs.dist_tag }} run: npm publish --access public --tag ${{ steps.version.outputs.dist_tag }} working-directory: ${{ matrix.package }}