Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/continuous-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Any Commit
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build
- run: pnpm dlx pkg-pr-new publish './packages/*' --packageManager=pnpm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publish step needs authentication for the package registry before it can successfully publish packages. Consider adding a step like:

- name: Setup npm authentication
  run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

Also, the current workflow triggers on all pushes and pull requests, which could lead to unintended package publications. It would be safer to add conditions to restrict when publishing occurs:

- name: Publish packages
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  run: pnpm dlx pkg-pr-new publish './packages/*' --packageManager=pnpm

This ensures packages are only published from the main branch when changes are pushed directly.

Suggested change
- run: pnpm dlx pkg-pr-new publish './packages/*' --packageManager=pnpm
- name: Setup npm authentication
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish packages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: pnpm dlx pkg-pr-new publish './packages/*' --packageManager=pnpm

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.