chore(release): prepare v0.1.0 #1
Workflow file for this run
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: Release JavaScript SDK | |
| on: | |
| push: | |
| tags: | |
| - "sdk-js-v*.*.*" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: sdk/javascript | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| cache-dependency-path: sdk/javascript/package-lock.json | |
| - run: npm install -g npm@11 | |
| - name: Verify tag matches package version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#sdk-js-v}" | |
| PACKAGE_VERSION="$(node -p "require('./package.json').version")" | |
| if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
| echo "tag version $TAG_VERSION does not match package.json version $PACKAGE_VERSION" >&2 | |
| exit 1 | |
| fi | |
| - run: npm ci | |
| - run: npm test | |
| - run: npm run build | |
| - run: npm publish --provenance | |
| - name: Delete tag on failure | |
| if: failure() | |
| run: git push --delete origin "${{ github.ref_name }}" |