Skip to content

Commit

Permalink
Upgrade Version to 0.5.0 (#47)
Browse files Browse the repository at this point in the history
* Committing version upgrade script

* Fixes to the upgrade script

* Upgrade version to 0.5.0

* Update Cargo.toml

No longer optional

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>

* Fixed small issue in the version upgrade script

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Boppy <no-reply@boppygames.gg>
  • Loading branch information
2 people authored and cloutiertyler committed Aug 1, 2023
1 parent e4a741a commit 41dc128
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 68 deletions.
59 changes: 14 additions & 45 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-bench"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "Bench library/utility for SpacetimeDB"
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-bindings-macro"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "Easy support for interacting between SpacetimeDB and Rust."
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-bindings-sys"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "Easy support for interacting between SpacetimeDB and Rust."
Expand Down
8 changes: 4 additions & 4 deletions crates/bindings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "Easy support for interacting between SpacetimeDB and Rust."
Expand All @@ -16,9 +16,9 @@ bench = false
getrandom = ["spacetimedb-bindings-sys/getrandom"]

[dependencies]
spacetimedb-bindings-sys = { path = "../bindings-sys", version = "0.4.1" }
spacetimedb-lib = { path = "../lib", default-features = false, version = "0.4.1"}
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.4.1"}
spacetimedb-bindings-sys = { path = "../bindings-sys", version = "0.5.0" }
spacetimedb-lib = { path = "../lib", default-features = false, version = "0.5.0"}
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.5.0"}
once_cell = "1.15.0"
scoped-tls = "1.0.1"
log = "0.4.17"
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-cli"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "A command line interface for SpacetimeDB"
Expand All @@ -26,7 +26,7 @@ serde_json = { version = "1.0", features = ["raw_value", "preserve_order"] }
toml = "0.5"
dirs = "4.0"
tabled = "0.8.0"
spacetimedb-lib = { path = "../lib", version = "0.4.1" }
spacetimedb-lib = { path = "../lib", version = "0.5.0" }
convert_case = "0.6.0"
wasmtime = { version = "7", default-features = false, features = ["cranelift"] }
colored = "2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/subcommands/project/Cargo._toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
spacetimedb = "0.4.1"
spacetimedb = "0.5.0"
log = "0.4"
2 changes: 1 addition & 1 deletion crates/client-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-client-api"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
publish = false

Expand Down
2 changes: 1 addition & 1 deletion crates/client-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-client-sdk"
version = "0.1.0"
version = "0.5.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-core"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
publish = false

Expand Down
6 changes: 3 additions & 3 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-lib"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "A common library for SpacetimeDB"
Expand All @@ -25,8 +25,8 @@ hex = "0.4.3"
thiserror = "1.0.37"
itertools = "0.10.5"
anyhow = "1.0.68"
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.4.1" }
spacetimedb-sats = { path = "../sats", version = "0.4.1" }
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.5.0" }
spacetimedb-sats = { path = "../sats", version = "0.5.0" }
serde_with = { version = "2.2.0", optional = true }
chrono = { version = "0.4.23", optional = true, default-features = false }

Expand Down
4 changes: 2 additions & 2 deletions crates/sats/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-sats"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
license-file = "LICENSE"
description = "Spacetime Algebraic Type Notation"
Expand All @@ -14,7 +14,7 @@ serde = ["dep:serde", "hex"]
decorum = { version = "0.3.1", default-features = false, features = ["std"] }
enum-as-inner = "0.6"
serde = { version = "1.0.136", optional = true }
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.4.1" }
spacetimedb-bindings-macro = { path = "../bindings-macro", version = "0.5.0" }
hex = { version = "0.4.3", optional = true }
itertools = "0.10.5"
thiserror = "1.0.38"
Expand Down
2 changes: 1 addition & 1 deletion crates/standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedb-standalone"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
publish = false

Expand Down
8 changes: 4 additions & 4 deletions crates/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
spacetimedb-lib = { path = "../lib", version = "0.4.1" }
spacetimedb-core = { path = "../core", version = "0.4.1" }
spacetimedb-standalone = { path = "../standalone", version = "0.4.1" }
spacetimedb-client-api = { path = "../client-api", version = "0.4.1" }
spacetimedb-lib = { path = "../lib", version = "0.5.0" }
spacetimedb-core = { path = "../core", version = "0.5.0" }
spacetimedb-standalone = { path = "../standalone", version = "0.5.0" }
spacetimedb-client-api = { path = "../client-api", version = "0.5.0" }

tokio = { version = "1.25", features = ["full"]}
anyhow = "1.0"
Expand Down
69 changes: 69 additions & 0 deletions tools/upgrade-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -euo pipefail

if [ $# != 1 ] ; then
echo "Incorrect number of arguments. Expected: 1 Received: $#"
exit 1
fi

fsed() {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i.sed_bak "$@"
rm -f "$2.sed_bak"
else
sed -i "$@"
fi
}

version="$1"
declare -a crates=("bench" "bindings" "bindings-macro" "bindings-sys" "client-api-messages" "cli" "client-api" "core" "lib" "sats" "standalone" "testing")
upgrade_version() {
toml=crates/$1/Cargo.toml
if [ ! -f "$toml" ] ; then
echo "Invalid crate: $1"
exit 1
fi

# Upgrade the crate version
if [[ $# -lt 2 ]] || [ "$2" != "--skip-version" ] ; then
fsed '3s/.*version.*/version = "'"${version}"'"/' "${toml}"
fi

# Upgrade any dependencies
for crate in "${crates[@]}" ; do
if [[ $# -lt 2 ]] || [ "$2" != "--no-include-version" ] ; then
fsed 's/.*'"spacetimedb-${crate}"'\s*=.*/'"spacetimedb-${crate}"' = { path = "..\/'"${crate}"'", version = "'"$version"'" }/' "${toml}"
else
fsed 's/.*'"spacetimedb-${crate}"'\s*=.*/'"spacetimedb-${crate}"' = { path = "..\/'"${crate}"'" }/' "${toml}"
fi
done
}

upgrade_version bench --no-include-version
upgrade_version client-api --no-include-version
upgrade_version core --no-include-version
upgrade_version standalone --no-include-version

upgrade_version bindings
upgrade_version bindings-macro
upgrade_version bindings-sys
upgrade_version cli
upgrade_version lib
upgrade_version sats
upgrade_version client-sdk

upgrade_version testing --skip-version

# Upgrade the template that is shipped with the cli
fsed 's@.*spacetimedb.*=.*".*".*@spacetimedb = "'"${version}"'"@' "crates/cli/src/subcommands/project/Cargo._toml"
fsed 's@.*spacetimedb-lib.*=.*@spacetimedb-lib = { path = "../lib", default-features = false }@' "crates/bindings/Cargo.toml"
fsed 's@.*spacetimedb-bindings-macro.*=.*@spacetimedb-bindings-macro = { path = "../bindings-macro" }@' "crates/bindings/Cargo.toml"

# Maintain any other options
fsed 's@.*spacetimedb-lib.*=.*@spacetimedb-lib = { path = "../lib", default-features = false, version = "'"$version"'"}@' "crates/bindings/Cargo.toml"
fsed 's@.*spacetimedb-bindings-macro.*=.*@spacetimedb-bindings-macro = { path = "../bindings-macro", version = "'"$version"'"}@' "crates/bindings/Cargo.toml"

cargo check

printf "Upgrade to version %s was successful.\n\n" "${version}"

0 comments on commit 41dc128

Please sign in to comment.