Skip to content

Commit 8ee8326

Browse files
[skip ci] handle npm publish failure during release task
1 parent 7360285 commit 8ee8326

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Rakefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ task :publish, [:tag] do |t, args|
398398
tarball = Dir.glob("release/#{artifact}/*")
399399
next if tarball.empty?
400400
tarball = tarball[0]
401-
sh %Q(npm publish --tag next #{tarball})
401+
# tolerate failure as a case that has already been released
402+
sh_or_warn %Q(npm publish --tag next #{tarball})
402403
end
403404
sh %Q(gh release create #{args[:tag]} --title #{args[:tag]} --notes-file release/note.md --prerelease #{files.join(" ")})
404405
end
@@ -420,3 +421,11 @@ end
420421
def lib_wasi_vfs_a
421422
ENV["LIB_WASI_VFS_A"]
422423
end
424+
425+
def sh_or_warn(*cmd)
426+
sh *cmd do |ok, status|
427+
unless ok
428+
warn "Command failed with status (#{status.exitstatus}): #{cmd.join ""}"
429+
end
430+
end
431+
end

0 commit comments

Comments
 (0)