name: Publish SDK on: workflow_dispatch: inputs: bump: description: "Semver bump for the release" type: choice options: [patch, minor, major] default: patch schedule: # Daily data release, after the hourly model syncs have merged. - cron: "23 5 * * *" concurrency: publish-sdk jobs: publish: if: github.repository == 'anomalyco/models.dev' runs-on: ubuntu-latest permissions: contents: write # push sdk-v* tags on manual releases id-token: write # npm trusted publishing (OIDC) + provenance steps: - name: Checkout code uses: actions/checkout@v4 with: ref: dev - name: Setup Bun uses: oven-sh/setup-bun@v1 with: bun-version: latest - name: Setup Node uses: actions/setup-node@v4 with: node-version: 24 registry-url: https://registry.npmjs.org - name: Install dependencies run: bun install - name: Validate models run: bun validate - name: SDK tests run: bun run test working-directory: packages/sdk - name: Publish id: publish run: > bun script/publish.ts --bump=${{ inputs.bump || 'patch' }} ${{ github.event_name == 'schedule' && '--if-changed' || '' }} working-directory: packages/sdk - name: Tag release if: github.event_name == 'workflow_dispatch' && steps.publish.outputs.version != '' run: | git tag "sdk-v${{ steps.publish.outputs.version }}" git push origin "sdk-v${{ steps.publish.outputs.version }}"