File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 21
21
- name : Build
22
22
run : pnpm run --filter='!@typespec/website' build
23
23
24
- - run : pnpx pkg-pr-new publish './packages/*' --pnpm
24
+ - run : pnpm tsx eng/tsp-core/ pkg-pr-new.ts
Original file line number Diff line number Diff line change
1
+ import { execSync } from "child_process" ;
2
+ import { readdir } from "fs/promises" ;
3
+ import { repoRoot } from "../common/scripts/utils/common.js" ;
4
+ import { listChangedFilesSince } from "../common/scripts/utils/git.js" ;
5
+
6
+ const files = await listChangedFilesSince ( `origin/main` , { repositoryPath : repoRoot } ) ;
7
+
8
+ // eslint-disable-next-line no-console
9
+ console . log ( "modified files:" , files ) ;
10
+
11
+ const packages = await readdir ( repoRoot + "/packages" , { withFileTypes : true } ) ;
12
+ const paths = packages
13
+ . filter ( ( dirent ) => dirent . isDirectory ( ) && dirent . name !== "http-client-python" )
14
+ . map ( ( dirent ) => `packages/${ dirent . name } ` ) ;
15
+
16
+ const modifiedPaths = paths . filter ( ( x ) => files . some ( ( f ) => f . startsWith ( x ) ) ) ;
17
+ // eslint-disable-next-line no-console
18
+ console . log ( "Packages" , { all : paths , modified : modifiedPaths } ) ;
19
+ try {
20
+ execSync ( `pnpx pkg-pr-new publish '${ paths . join ( " " ) } ' --pnpm` , {
21
+ stdio : "inherit" ,
22
+ encoding : "utf-8" ,
23
+ } ) ;
24
+ } catch ( e : any ) {
25
+ // eslint-disable-next-line no-console
26
+ console . error ( "Failed to run pkg-pr-new publish" ) ;
27
+ }
You can’t perform that action at this time.
0 commit comments