Skip to content

Commit deff02d

Browse files
Support non-nightly npm package publishment
1 parent c6f990e commit deff02d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tasks/packaging.rake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ desc "Publish artifacts as a GitHub Release"
155155
task :publish, [:tag] do |t, args|
156156
RubyWasm::Toolchain.check_executable("gh")
157157

158+
nightly = /-\d{4}-\d{2}-\d{2}-a$/.match?(args[:tag])
158159
files = RELASE_ARTIFACTS.flat_map do |artifact|
159160
Dir.glob("release/#{artifact}/*")
160161
end
@@ -166,7 +167,8 @@ task :publish, [:tag] do |t, args|
166167
next if tarball.empty?
167168
tarball = tarball[0]
168169
# tolerate failure as a case that has already been released
169-
sh_or_warn %Q(npm publish --tag next #{tarball})
170+
npm_tag = nightly ? "next" : "latest"
171+
sh_or_warn %Q(npm publish --tag #{npm_tag} #{tarball})
170172
end
171173
sh %Q(gh release create #{args[:tag]} --title #{args[:tag]} --notes-file release/note.md --prerelease #{files.join(" ")})
172174
end

0 commit comments

Comments
 (0)