-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support preview release using pkg-pr-new #54
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,29 @@ | ||||||||||||||||
name: Preview Release | ||||||||||||||||
|
||||||||||||||||
on: | ||||||||||||||||
push: | ||||||||||||||||
branches: | ||||||||||||||||
- main | ||||||||||||||||
pull_request: | ||||||||||||||||
|
||||||||||||||||
jobs: | ||||||||||||||||
preview-release: | ||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||
steps: | ||||||||||||||||
- 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 | ||||||||||||||||
|
||||||||||||||||
- name: Publish packages preview with pkg-pr-new CLI | ||||||||||||||||
run: pnpx pkg-pr-new publish | ||||||||||||||||
Comment on lines
+28
to
+29
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. Add authentication setup for package publishing The publish step needs:
- name: Publish packages preview with pkg-pr-new CLI
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
run: pnpx pkg-pr-new publish 📝 Committable suggestion
Suggested change
|
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.
🛠️ Refactor suggestion
Add permissions and consider restricting PR triggers
The workflow should:
📝 Committable suggestion