@@ -62,19 +62,21 @@ def rake_task_matrix
62
62
end
63
63
npm_entries =
64
64
NPM_PACKAGES . map do |pkg |
65
+ package_json =
66
+ JSON . parse (
67
+ File . read ( "packages/npm-packages/#{ pkg [ :name ] } /package.json" )
68
+ )
65
69
entry = {
66
70
task : "npm:#{ pkg [ :name ] } " ,
67
71
prerelease : "npm:configure_prerelease" ,
68
72
artifact : "packages/npm-packages/#{ pkg [ :name ] } /#{ pkg [ :name ] } -*.tgz" ,
69
73
artifact_name : "npm-#{ pkg [ :name ] } " ,
74
+ # Skip publishing packages with `"private": true`
75
+ should_publish : !package_json [ "private" ] ,
70
76
builder : pkg [ :target ] ,
71
77
rubies_cache_key : npm_pkg_rubies_cache_key ( pkg )
72
78
}
73
79
# Run tests only if the package has 'test' script
74
- package_json =
75
- JSON . parse (
76
- File . read ( "packages/npm-packages/#{ pkg [ :name ] } /package.json" )
77
- )
78
80
if package_json [ "scripts" ] && package_json [ "scripts" ] [ "test" ]
79
81
entry [ :test ] = "npm:#{ pkg [ :name ] } :check"
80
82
end
96
98
namespace :ci do
97
99
task :rake_task_matrix do
98
100
content = JSON . generate ( rake_task_matrix . flat_map { |_ , entries | entries } )
99
- File . write ( "ci_matrix.json" , content )
101
+ output = "ci_matrix.json"
102
+ File . write ( "#{ output } " , content )
103
+ puts "Created \" #{ output } \" "
100
104
end
101
105
102
106
task :pin_build_manifest do
@@ -140,6 +144,7 @@ namespace :ci do
140
144
. map { |entry | "release/#{ entry [ :artifact_name ] } /*" }
141
145
File . open ( "release/note.md" , "w" ) { |f | f . print release_note }
142
146
matrix [ :npm ] . each do |task |
147
+ next unless task [ :should_publish ]
143
148
artifact = task [ :artifact_name ]
144
149
tarball = Dir . glob ( "release/#{ artifact } /*" )
145
150
next if tarball . empty?
0 commit comments