chore: release v1.3.0 #9
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: Publish Package to npmjs | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const sha = context.sha; | |
| const startedAt = Date.now(); | |
| const timeoutMs = 15 * 60 * 1000; | |
| const intervalMs = 15 * 1000; | |
| while (true) { | |
| const runs = await github.paginate(github.rest.actions.listWorkflowRuns, { | |
| owner, | |
| repo, | |
| workflow_id: "ci.yml", | |
| branch: "main", | |
| event: "push", | |
| per_page: 100, | |
| }); | |
| const run = runs.find((candidate) => candidate.head_sha === sha); | |
| if (run?.status === "completed") { | |
| if (run.conclusion === "success") { | |
| core.info(`Matched successful CI run: ${run.html_url}`); | |
| return; | |
| } | |
| core.setFailed( | |
| `Release is blocked because CI for ${sha} concluded with '${run.conclusion}'.`, | |
| ); | |
| return; | |
| } | |
| if (Date.now() - startedAt > timeoutMs) { | |
| core.setFailed( | |
| `Timed out waiting for the CI workflow on main to finish for ${sha}.`, | |
| ); | |
| return; | |
| } | |
| core.info(`Waiting for CI on main to finish for ${sha}...`); | |
| await new Promise((resolve) => setTimeout(resolve, intervalMs)); | |
| } | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.5" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.22.1" | |
| registry-url: "https://registry.npmjs.org" | |
| - run: bun install --frozen-lockfile | |
| - run: bun run repair:realm | |
| - run: bun run check | |
| - run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |