File: release.sh

package info (click to toggle)
rust-rb-sys 0.9.124-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: ansic: 198; sh: 16; makefile: 2
file content (22 lines) | stat: -rwxr-xr-x 586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

if ! git diff-index --quiet HEAD --; then
  echo "There are git changes, cannot release"
  exit 1
fi


read -rp "What version would you like to release? (current $(grep version Cargo.toml)): " version
read -rp "Are you sure you want to bump to v$version? <y/N> " prompt

if [[ $prompt =~ [yY](es)* ]]; then
  sed -i '' "s/^version = .*/version = \"$version\"/g" Cargo.toml
  cargo build
  git add Cargo.lock Cargo.toml ../../Cargo.lock
  git commit -am "Bump to v$version"
  git tag "v$version"
  git push --atomic origin main "v$version"
fi