Publish to npm (TS) #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to npm (TS) | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./ts-sdk | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate version.ts | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "export const SDK_VERSION = '${VERSION}';" > src/version.ts | |
| - name: Build project | |
| run: npm run build --if-present | |
| - name: Run tests | |
| run: npm test --if-present | |
| - name: Copy root LICENSE to ts-sdk | |
| run: cp LICENSE ts-sdk/LICENSE | |
| - name: Publish Package | |
| run: npm publish --access public --tag beta |