-
Notifications
You must be signed in to change notification settings - Fork 13
feat(ci): add pkg.pr.new canary releases #874
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 5 commits
b00f165
5e6e9cf
131e95e
6b6f3af
dc3fa9c
ab1715d
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,49 @@ | ||
| name: Canary Release | ||
|
|
||
| # Publishes a preview build of @raystack/apsara to pkg.pr.new on every push | ||
| # to a pull request or to main, so changes can be installed and tested | ||
| # before a real npm release. See https://pkg.pr.new | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: {} | ||
|
|
||
| # --comment=update edits a single comment per PR; cancel superseded runs so a | ||
| # stale run can't finish after a newer one and leave outdated info behind. | ||
| concurrency: | ||
| group: canary-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish to pkg.pr.new | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout 🛎️ | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup pnpm 9 | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.3.0 | ||
|
|
||
| - name: Setup Node.js 22.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.x | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install Dependencies 🔧 | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build Step 🔧 | ||
| run: pnpm build:apsara | ||
|
|
||
| - name: Publish 🚀 | ||
| run: pnpm exec pkg-pr-new publish ./packages/raystack --comment=update | ||
|
Contributor
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. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== workflow line =="
cat -n .github/workflows/canary.yaml | sed -n '35,45p'
echo
echo "== pkg.pr.new related docs/config =="
rg -n "pkg\.pr\.new|pkg-pr-new|--commentWithSha|--packageManager|commentWithSha|packageManager" -S .github README.md packages 2>/dev/null || true
echo
echo "== package manager/package info =="
for f in package.json pnpm-workspace.yaml pnpm-lock.yaml; do
if [ -f "$f" ]; then
echo "--- $f ---"
sed -n '1,120p' "$f"
fi
doneRepository: raystack/apsara Length of output: 6132 🌐 Web query:
💡 Result: pkg.pr.new is a tool for creating continuous, npm-compatible preview releases directly from your GitHub pull requests and commits without publishing to the npm registry [1][2]. Below are the details regarding the configuration flags you inquired about: --commentWithSha This flag controls the format of the installation URLs generated in the GitHub comments posted by the bot [3]. - When set to true, the bot uses the commit SHA instead of the pull request number in the generated install commands (e.g., npm i https://pkg.pr.new/package@a832a55) [3]. - When set to false (default), it uses the pull request number (e.g., npm i https://pkg.pr.new/package@123), which can sometimes lead to caching issues because the URL remains the same for different commits within the same PR [4][3]. --packageManager=XYZ This flag allows you to customize the package manager syntax reflected in the bot's comments [1][3]. - Supported values for XYZ are: npm (default), pnpm, yarn, or bun [1][5]. - You can provide multiple comma-separated values (e.g., --packageManager=npm,pnpm) to show snippets for different package managers simultaneously [1][2]. Additional Context: - Usage: These flags are typically passed to the pkg-pr-new command in your GitHub Actions workflows (e.g., pnpm exec pkg-pr-new publish --commentWithSha --packageManager=npm,pnpm) [6][1][5]. - Defaults: By default, the tool uses npm as the package manager and includes the pull request number in the comment links [5][3]. - Other Flags: The tool also offers --bin (to show npx execute commands instead of install commands for CLI apps) and --no-compact (to force long-form URLs) [1][2][5]. For more control, you can use --comment=off in combination with the --json flag to generate metadata and create your own custom GitHub comments via the GitHub Actions API [2][7]. Citations:
Publish pkg.pr.new previews for the pnpm workspace.
🧰 Tools🪛 zizmor (1.28.0)[info] 41-41: prefer trusted publishing for authentication (use-trusted-publishing): this command (use-trusted-publishing) 🤖 Prompt for AI Agents
Contributor
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. Let's use the
Contributor
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. Also I think we should use
From their docs^ |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.