cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
.github/workflows/publish-npm.yml
32lines · modecode
| 1 | # This workflow is triggered when a GitHub release is created. |
| 2 | # It can also be run manually to re-publish to NPM in case it failed for some reason. |
| 3 | # You can run this workflow by navigating to https://www.github.com/cloudflare/cloudflare-typescript/actions/workflows/publish-npm.yml |
| 4 | name: Publish NPM |
| 5 | on: |
| 6 | workflow_dispatch: |
| 7 | |
| 8 | release: |
| 9 | types: [published] |
| 10 | |
| 11 | jobs: |
| 12 | publish: |
| 13 | name: publish |
| 14 | runs-on: ubuntu-latest |
| 15 | |
| 16 | steps: |
| 17 | - uses: actions/checkout@v4 |
| 18 | |
| 19 | - name: Set up Node |
| 20 | uses: actions/setup-node@v3 |
| 21 | with: |
| 22 | node-version: '20' |
| 23 | |
| 24 | - name: Install dependencies |
| 25 | run: | |
| 26 | yarn install |
| 27 | |
| 28 | - name: Publish to NPM |
| 29 | run: | |
| 30 | bash ./bin/publish-npm |
| 31 | env: |
| 32 | NPM_TOKEN: ${{ secrets.CLOUDFLARE_NPM_TOKEN || secrets.NPM_TOKEN }} |