Skip to content

Commit b6c8f79

Browse files
add preview workflow that publishes to pkg-pr-new
1 parent 37a4567 commit b6c8f79

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/preview.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish from PR
2+
on:
3+
pull_request:
4+
paths:
5+
- 'typescript/**'
6+
- '!typescript/**/*.md' # Exclude markdown files using ! prefix
7+
- '!typescript/README.md'
8+
9+
jobs:
10+
publish-to-pkg-pr:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install dependencies
25+
working-directory: ./typescript
26+
run: npm ci
27+
28+
- name: Generate types and build package
29+
working-directory: ./typescript
30+
run: |
31+
npm run generate-types
32+
npm run build
33+
34+
- name: Run tests
35+
working-directory: ./typescript
36+
run: npm test
37+
38+
- run: npx pkg-pr-new publish --npm .

0 commit comments

Comments
 (0)