luthor/version_bump.sh

26 lines
1008 B
Bash
Raw Permalink Normal View History

2021-01-05 07:32:52 +00:00
#!/usr/bin/env bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit
if [ 1 -eq "$#" ]
2021-01-05 07:32:52 +00:00
then
echo "Version bump to $1"
sed --in-place --regexp-extended 's/version = "([0-9].[0-9].[0-9])"/version = "'"$1"'"/g' luthor/pyproject.toml
git add luthor/pyproject.toml
sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.prod.ts
git add otis/src/environments/environment.prod.ts
sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.ts
git add otis/src/environments/environment.ts
sed --in-place --regexp-extended 's/"version": "([0-9].[0-9].[0-9])"/"version": "'"$1"'"/g' otis/package.json
git add otis/package.json
git commit -m "Version Bump v$1"
git tag "v$1"
else
echo "No version bump"
2021-01-05 07:32:52 +00:00
fi
git push
git tag --delete latest
git tag latest
git push --delete origin latest
git push --tags