-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·31 lines (23 loc) · 819 Bytes
/
Copy pathrelease.sh
File metadata and controls
executable file
·31 lines (23 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -euxo pipefail
kind="$1"
case "$kind" in
patch|minor|major) ;;
*)
echo "Usage: release.sh {patch|minor|major}"
exit 1
;;
esac
cargo workspaces version "$kind" --yes --no-git-commit
if git diff --quiet Cargo.toml Cargo.lock */Cargo.toml; then
exit 0
fi
VERSION=$(toml get Cargo.toml workspace.package.version | tr -d '"')
toml set python/pyproject.toml project.version "$VERSION" | sponge python/pyproject.toml
jq --arg v "$VERSION" '.version = $v' wasm/package.json | sponge wasm/package.json
# Sanity-check that all three package manifests now agree before tagging.
bash scripts/check-versions.sh
# Create a fresh release commit (never --amend: that would rewrite the previous,
# possibly already-pushed, commit).
git commit -am "Release v$VERSION"
git tag "v$VERSION"