vault-link/scripts/bump-version.sh
Andras Schmelczer 4482e0155f
Some checks failed
Check / build (push) Waiting to run
E2E tests / build (push) Waiting to run
Publish CLI / publish-docker (push) Waiting to run
Publish server Docker image / publish-docker (push) Waiting to run
Deploy Documentation / build (push) Has been cancelled
Migrate to forgejo & reformat (#189)
- Migrate to forgejo
- Bump Rust & Node
- Reformat project
- Small script cleanup

Reviewed-on: https://home.schmelczer.dev/git/git/andras/vault-link/pulls/189
Co-authored-by: Andras Schmelczer <andras@schmelczer.dev>
Co-committed-by: Andras Schmelczer <andras@schmelczer.dev>
2026-05-08 21:53:33 +01:00

50 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
set -e
if [[ -z $1 ]]; then
echo "Usage: $0 {patch|minor|major}"
exit 1
fi
if [[ $1 =~ ^(patch|minor|major)$ ]]; then
echo "Creating a new '$1' version"
else
echo "Invalid argument: $1"
echo "Usage: $0 {patch|minor|major}"
exit 1
fi
cargo install cargo-edit --force
if [[ -n $(git status --porcelain) ]]; then
echo "Your working directory is not clean. Please commit or stash your changes before proceeding."
exit 1
else
echo "Your working directory is clean."
fi
echo "Bumping sync-server versions"
cd sync-server
cargo set-version --bump $1
echo "Bumping frontend versions"
cd ../frontend
npm version $1 --workspaces
cd ..
cp frontend/obsidian-plugin/manifest.json manifest.json # for BRAT, otherwise it wouldn't update
# Format all files across the project (frontend and backend)
npx -C frontend prettier --write "**/*.{ts,js,json,md,yml,yaml}"
# Commit and tag
git add .
TAG=$(node -p "require('./frontend/obsidian-plugin/package.json').version")
git commit -m "Bump versions to $TAG"
git push
echo "Tagging $TAG"
git tag -a $TAG -m "Release $TAG"
git push origin $TAG
echo "Done"