Publish #173
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 | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| branches: | |
| - main | |
| types: | |
| - completed | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write # Required for git tag | |
| jobs: | |
| npm-publish: | |
| name: npm-publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: check | |
| uses: EndBug/version-check@1d7d917a07973cd80343b97a30ab1feca68dd4c6 | |
| with: | |
| static-checking: remoteIsNew | |
| file-url: https://unpkg.com/typedoc-plugin-mdn-links/package.json | |
| - name: Set up Node | |
| if: steps.check.outputs.changed == 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Upgrade npm # Hack to deal with needing a new version for OIDC | |
| if: steps.check.outputs.changed == 'true' | |
| run: npm install -g npm@11 | |
| - name: Install pnpm | |
| if: steps.check.outputs.changed == 'true' | |
| run: npm install -g pnpm@10 | |
| - name: Install | |
| if: steps.check.outputs.changed == 'true' | |
| run: pnpm install | |
| - name: Build | |
| if: steps.check.outputs.changed == 'true' | |
| run: pnpm build | |
| - name: Publish | |
| if: steps.check.outputs.changed == 'true' | |
| run: | | |
| pnpm publish | |
| git tag v$(jq .version package.json -r) | |
| git push --tags |