publish-npm #71
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-npm | |
| on: | |
| workflow_run: | |
| workflows: [build-and-upload-binaries] | |
| types: [completed] | |
| permissions: | |
| id-token: write # OIDC for npm Trusted Publishing | |
| jobs: | |
| on-success: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Setup | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Checkout | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| registry-url: "https://registry.npmjs.org/" | |
| node-version-file: "./rari-npm/package.json" | |
| package-manager-cache: false | |
| # Ensure npm 11.5.1 or later for trusted publishing | |
| - name: Install latest npm | |
| run: npm install -g npm@latest | |
| - name: Generate Schema | |
| working-directory: ./rari-npm | |
| run: npm install && npm run export-schema && npm run generate-types | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish | |
| working-directory: ./rari-npm | |
| run: npm publish --access public --provenance |