Skip to content

Commit

Permalink
add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Jun 25, 2023
1 parent 49a5a32 commit d74b4cb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions scripts/release-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

[ -z "$(git status --porcelain)" ] || (echo "dirty working directory" && exit 1)

current_version="$(grep '^version = ' Cargo.toml | head -1 | cut -d '"' -f2)"
new_version="$1"

if [ -z "$new_version" ]; then
echo "New version required as argument"
exit 1
fi

echo ">>> Bumping version"

readme_pattern='\(untitaker\/spacemod[@:]\)'
sed -i.bak "s/version = \"$current_version\"/version = \"$new_version\"/" Cargo.toml
rm Cargo.toml.bak

echo ">>> Running tests"
cargo build
cargo test

echo ">>> Commit"

git add README.md
git add Cargo.toml
git commit -am "version $new_version"
git tag v$new_version

echo "things left to do:"
echo " cargo publish"
echo " npm publish https://github.com/untitaker/spacemod/releases/download/v$new_version/spacemod-npm-package.tar.gz"

0 comments on commit d74b4cb

Please sign in to comment.