Skip to content

Commit bae9700

Browse files
committed
Done. Here's what I added:
**Created `.github/workflows/publish-preview.yml`** - A new GitHub Action workflow that: - Triggers on pull requests and pushes to main - Builds all workspace packages - Publishes preview packages using pkg.pr.new with compact URLs **Updated `package.json` (root)** - Added a root-level `build` script for npm workspaces. **Updated `packages/core/package.json`** - Added the `repository` field (other packages already had it) to enable the `--compact` flag for shorter URLs. **Next step**: Install the [pkg.pr.new GitHub App](https://github.com/apps/pkg-pr-new) on the repository to activate the preview publishing.
1 parent 50ae06e commit bae9700

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Preview
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build packages
26+
run: npm run build --workspaces
27+
28+
- name: Publish preview packages
29+
run: npx pkg-pr-new publish --compact './packages/*'

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"workspaces": [
55
"packages/*"
66
],
7+
"scripts": {
8+
"build": "npm run build --workspaces"
9+
},
710
"dependencies": {},
811
"devDependencies": {
912
"lerna": "^8.1.8"

packages/core/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "@nestixis/nestjs-inbox-outbox",
33
"version": "1.0.1",
44
"description": "NestJS Inbox Outbox pattern implementation with extensible database drivers",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/Nestixis/nestjs-inbox-outbox.git"
8+
},
59
"scripts": {
610
"build": "tsc",
711
"tsc:publish": "tsc && npm publish",

0 commit comments

Comments
 (0)