Repository navigation
chore(ci): publish package previews #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Publish Package Previews | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 | ||
| with: | ||
| node-version: 24.19.0 | ||
| package-manager-cache: false | ||
|
|
||
| - name: Install Pnpm | ||
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | ||
| with: | ||
| run_install: true | ||
|
|
||
| - name: Build Packages | ||
| run: node --run build | ||
|
|
||
| - name: Publish Package Previews | ||
| run: pnpm exec pkg-pr-new publish --pnpm --previewVersion --no-template './packages/rstack' './packages/create-rstack' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { readFile } from 'node:fs/promises'; | ||
| import { expect, test } from 'rstack/test'; | ||
|
|
||
| test('publishes pull request previews for public packages', async () => { | ||
| const [workflow, packageJson, workspace] = await Promise.all([ | ||
| readFile( | ||
| new URL('../../../.github/workflows/pkg-pr-new.yml', import.meta.url), | ||
| 'utf8', | ||
| ), | ||
| readFile(new URL('../../../package.json', import.meta.url), 'utf8'), | ||
| readFile(new URL('../../../pnpm-workspace.yaml', import.meta.url), 'utf8'), | ||
| ]); | ||
|
|
||
| expect(workflow).toContain('pkg-pr-new publish --pnpm --previewVersion'); | ||
| expect(workflow).toContain("'./packages/rstack'"); | ||
| expect(workflow).toContain("'./packages/create-rstack'"); | ||
| expect(workflow).not.toContain('head.repo.full_name == github.repository'); | ||
| expect(packageJson).toContain('"pkg-pr-new": "catalog:"'); | ||
| expect(workspace).toContain('pkg-pr-new: 0.0.87'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When AGENTS.md reference: AGENTS.md:L33-L33 Useful? React with 👍 / 👎. |
||
| }); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a clean Linux x64 installation of this preview,
rs fmtand the formatting stage ofrs checkwill throwCannot find native binding. This step runs the manifest's build script (node --help: “Run a script specified in package.json”), which is onlyrslibforrstack. A repo-wide artifact search found no checked-in.nodebinaries, andpackages/rstack/package.jsondeclares no platform-native optional dependencies, so the formatter'sloadNativeBinding()call has neither a local binary nor an installed fallback package. Ensure previews include or depend on matching native bindings before publishing, analogous to the native preparation in.github/workflows/release.yml:88-102.Useful? React with 👍 / 👎.