Skip to content

Commit

Permalink
Update version, add release script (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
KCarretto committed Oct 30, 2023
1 parent a6c60cd commit 8feb9e9
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 5 deletions.
2 changes: 1 addition & 1 deletion implants/golem/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "golem"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion implants/imix/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imix"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion implants/lib/eldritch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eldritch"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions implants/lib/tavern/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tavern"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -21,4 +21,4 @@ tokio = { workspace = true, features = ["full"] }

[dev-dependencies]
httptest = { workspace = true }
tokio-test = { workspace = true }
tokio-test = { workspace = true }
57 changes: 57 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/sh

VERSION=$1
if [ -z "$VERSION" ]
then
echo "Please specify a version, for example ./release.sh 0.3.0"
exit 2
fi

echo "Now releasing Realm v$VERSION"
echo "Please go get some coffee, this may take a while ☕"

###
## Update Versions
###
echo "[v$VERSION] Updating build versions"
sed -i -E "s/version = \"[0-9].[0-9].[0-9]\"/version = \"$VERSION\"/" implants/imix/Cargo.toml
sed -i -E "s/version = \"[0-9].[0-9].[0-9]\"/version = \"$VERSION\"/" implants/golem/Cargo.toml
sed -i -E "s/version = \"[0-9].[0-9].[0-9]\"/version = \"$VERSION\"/" implants/lib/eldritch/Cargo.toml
sed -i -E "s/version = \"[0-9].[0-9].[0-9]\"/version = \"$VERSION\"/" implants/lib/tavern/Cargo.toml


###
## Rust Setup
###
echo "[v$VERSION] Installing dependencies"
apt update
apt install -y musl-tools gcc-mingw-w64

###
## Release Imix
###
cd ./implants/imix
echo "[v$VERSION] Building Imix Release $(pwd)"
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-gnu
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-unknown-linux-musl
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-pc-windows-gnu
cd ../..

###
## Release Golem
###
cd ./implants/golem
echo "[v$VERSION] Building Golem Release $(pwd)"
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-pc-windows-gnu
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-unknown-linux-musl
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target=x86_64-pc-windows-gnu
cd ../..


###
## Complete
###
echo "[v$VERSION][WARN] MacOS cannot be cross-compiled yet, please manually build artifacts"
echo "[v$VERSION] Release completed"

0 comments on commit 8feb9e9

Please sign in to comment.