Skip to content

Commit 338fcee

Browse files
Skip publishing packages with "private": true and mark p2 package as private
I'm not confident that the name of the package, `@ruby/head-wasm-wasip2`, is the best name for the package. So I'm marking it as private for now.
1 parent 5285a75 commit 338fcee

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ compile_commands.json
1515
html
1616

1717
build_manifest.json
18+
ci_matrix.json
1819

1920
vendor/bundle
2021
/pkg

packages/npm-packages/ruby-head-wasm-wasip2/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Ruby head built on WASI Preview 2",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.js",
7+
"private": true,
78
"exports": {
89
".": {
910
"browser": "./dist/esm/index.js",

rakelib/ci.rake

+10-5
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,21 @@ def rake_task_matrix
6262
end
6363
npm_entries =
6464
NPM_PACKAGES.map do |pkg|
65+
package_json =
66+
JSON.parse(
67+
File.read("packages/npm-packages/#{pkg[:name]}/package.json")
68+
)
6569
entry = {
6670
task: "npm:#{pkg[:name]}",
6771
prerelease: "npm:configure_prerelease",
6872
artifact: "packages/npm-packages/#{pkg[:name]}/#{pkg[:name]}-*.tgz",
6973
artifact_name: "npm-#{pkg[:name]}",
74+
# Skip publishing packages with `"private": true`
75+
should_publish: !package_json["private"],
7076
builder: pkg[:target],
7177
rubies_cache_key: npm_pkg_rubies_cache_key(pkg)
7278
}
7379
# 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-
)
7880
if package_json["scripts"] && package_json["scripts"]["test"]
7981
entry[:test] = "npm:#{pkg[:name]}:check"
8082
end
@@ -96,7 +98,9 @@ end
9698
namespace :ci do
9799
task :rake_task_matrix do
98100
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}\""
100104
end
101105

102106
task :pin_build_manifest do
@@ -140,6 +144,7 @@ namespace :ci do
140144
.map { |entry| "release/#{entry[:artifact_name]}/*" }
141145
File.open("release/note.md", "w") { |f| f.print release_note }
142146
matrix[:npm].each do |task|
147+
next unless task[:should_publish]
143148
artifact = task[:artifact_name]
144149
tarball = Dir.glob("release/#{artifact}/*")
145150
next if tarball.empty?

0 commit comments

Comments
 (0)