🚀 Publish @uverify/sdk to npm #28
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 @uverify/sdk to npm | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| if: "github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'typescript@')" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: 🔧 Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.14.0' | |
| registry-url: https://registry.npmjs.org | |
| cache: 'npm' | |
| cache-dependency-path: typescript/package-lock.json | |
| - name: ⬆️ Ensure npm supports Trusted Publishing | |
| run: npm i -g npm@^11.5.1 | |
| - name: 📦 Install Dependencies | |
| working-directory: ./typescript | |
| run: npm ci | |
| - name: ✅ Run Tests | |
| working-directory: ./typescript | |
| run: npm test | |
| - name: 🛠️ Build the Project | |
| working-directory: ./typescript | |
| run: npm run build | |
| - name: 🚀 Publish to npm (OIDC only) | |
| working-directory: ./typescript | |
| env: | |
| NPM_CONFIG_USERCONFIG: /dev/null | |
| run: | | |
| unset NODE_AUTH_TOKEN NPM_TOKEN | |
| npm publish --provenance --access public | |
| - name: ✅ Verify Published Package | |
| run: npm info @uverify/sdk |