Skip to content

Commit 2d33124

Browse files
authored
chore: Improve the bump command (#11226)
**Description:** Bump command should not bump the versions of binding crates, because those are managed by https://github.com/swc-project/swc/blob/2edbd40241b3402c8542241b1f8d82a4ebadd801/scripts/publish.sh . But before this PR, there was a bug related to packages that are not published to crates.io, so there was an issue in a commit like 5e6af60
1 parent 4bde508 commit 2d33124

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/swc-releaser/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ impl Bump<'_> {
210210
) -> Result<()> {
211211
eprintln!("Bumping crate: {pkg_name}");
212212

213-
let original_version = self
214-
.versions
215-
.get(pkg_name)
216-
.context(format!("failed to find original version for {pkg_name}"))?;
213+
let Some(original_version) = self.versions.get(pkg_name) else {
214+
eprintln!("No original version found for {pkg_name}, skipping bump");
215+
return Ok(());
216+
};
217217

218218
let mut new_version = original_version.clone();
219219

@@ -335,6 +335,10 @@ fn get_data() -> Result<(VersionMap, InternedGraph)> {
335335
let mut versions = VersionMap::new();
336336

337337
for pkg in md.workspace_packages() {
338+
if pkg.publish == Some(vec![]) {
339+
continue;
340+
}
341+
338342
versions.insert(pkg.name.clone(), pkg.version.clone());
339343
}
340344

0 commit comments

Comments
 (0)