diff --git a/.gitignore b/.gitignore index ea8c4bf..de358ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.vscode/ diff --git a/Cargo.lock b/Cargo.lock index d81318d..debb5a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1762,7 +1762,7 @@ dependencies = [ [[package]] name = "drift-gateway" -version = "1.2.2" +version = "1.2.3" dependencies = [ "actix-web", "argh", diff --git a/Cargo.toml b/Cargo.toml index d916c1e..740b8ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drift-gateway" -version = "1.2.2" +version = "1.2.3" edition = "2021" [dependencies] diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..ea4df74 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,29 @@ +#!/bin/bash +echo "Preparing gateway release.." + +# Check if working directory is clean +if [ -n "$(git status --porcelain)" ]; then + echo "Error: git working directory is not clean. Commit or stash changes first." + exit 1 +fi + +# Run checks +cargo check +cargo fmt --all -- --check + +# Get version from Cargo.toml +CARGO_VERSION=$(sed -n 's/^version = "\([0-9]*\.[0-9]*\.[0-9]*\)"/\1/p' Cargo.toml) +echo "Making release: v$CARGO_VERSION" + +# Check if tag already exists +if git rev-parse "v$CARGO_VERSION" >/dev/null 2>&1; then + echo "Error: Tag v$CARGO_VERSION already exists" + echo "Please update the version in Cargo.toml first" + exit 1 +fi + +# Create and push tag +git tag "v$CARGO_VERSION" +git push origin "v$CARGO_VERSION" + +echo "Release tag v$CARGO_VERSION pushed. GitHub Actions will handle the release."