Skip to content

Commit

Permalink
dev: shell script to update version of crates
Browse files Browse the repository at this point in the history
  • Loading branch information
hulxv committed Sep 6, 2024
1 parent d6357a1 commit bb1545b
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ html-generator = { path = "crates/html-generator" }
serde = "1.0.207"
tower-layer = "0.3.3"
tower-service = "0.3.3"
metassr-create = { version = "0.1.0", path = "crates/metassr-create" }
metassr-bundler = { version = "0.1.0", path = "crates/metassr-bundler" }
metassr-create = { path = "crates/metassr-create" }
metassr-bundler = { path = "crates/metassr-bundler" }

[workspace]
members = [
Expand Down
2 changes: 1 addition & 1 deletion crates/html-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "html-generator"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "A simple library to generate html content with a simple way."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
6 changes: 3 additions & 3 deletions crates/metassr-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-build"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "Web builder & client bundler (built on Rspack), built for MetaSSR."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -9,8 +9,8 @@ description = "Web builder & client bundler (built on Rspack), built for MetaSSR
metacall = "0.4.1"
anyhow = "1.0.82"
serde_json = "1.0.120"
metassr-utils = { version = "0.1.0", path = "../metassr-utils" }
metassr-utils = { path = "../metassr-utils" }
html-generator = { path = "../html-generator" }
lazy_static = "1.5.0"
serde = { version = "1.0.207", features = ["derive"] }
metassr-bundler = { version = "0.1.0", path = "../metassr-bundler" }
metassr-bundler = { path = "../metassr-bundler" }
2 changes: 1 addition & 1 deletion crates/metassr-bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ description = "A simple crate is used for web bundling built on Metacall and Rsp
anyhow = "1.0.86"
lazy_static = "1.5.0"
metacall = "0.4.1"
metassr-utils = { version = "0.1.0", path = "../metassr-utils" }
metassr-utils = { path = "../metassr-utils" }
serde_json = "1.0.128"
2 changes: 1 addition & 1 deletion crates/metassr-create/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-create"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
build = "build.rs"

Expand Down
4 changes: 2 additions & 2 deletions crates/metassr-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ edition = "2021"
anyhow = "1.0.82"
axum = "0.7.5"
chrono = "0.4.38"
metassr-build = { version = "0.1.0", path = "../metassr-build" }
metassr-utils = { version = "0.1.0", path = "../metassr-utils" }
metassr-build = { path = "../metassr-build" }
metassr-utils = { path = "../metassr-utils" }
serde_json = "1.0.122"
tokio = { version = "1.36.0", features = ["full"] }
tower-http = { version = "0.5.2", features = ["trace", "fs"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/metassr-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-utils"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "Important utilites for MetaSSR"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions metassr-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-cli"
version = "0.1.0-alpha"
version = "0.0.1-alpha"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -19,4 +19,4 @@ tracing-subscriber = { version = "0.3.18", features = ["fmt", "env-filter"] }
logger = { path = "../crates/logger" }
metassr-server = { path = "../crates/metassr-server" }
metassr-build = { path = "../crates/metassr-build" }
metassr-create = { version = "0.1.0", path = "../crates/metassr-create" }
metassr-create = { path = "../crates/metassr-create" }
22 changes: 22 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "Usage: $0 <new-version>"
exit 1
fi

NEW_VERSION=$1

update_version() {
local file=$1
echo "Updating version in $file to $NEW_VERSION"
# Use `sed` to find and replace the version in the Cargo.toml file
sed -i -E "s/^version = \"[^\"]+\"/version = \"$NEW_VERSION\"/" "$file"
}

# Find all Cargo.toml files and update their versions
find . -name 'Cargo.toml' -print0 | while IFS= read -r -d '' file; do
update_version "$file"
done

echo "Version update completed."

0 comments on commit bb1545b

Please sign in to comment.