File: release.sh

package info (click to toggle)
gdspy 1.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,020 kB
  • sloc: python: 9,180; cpp: 4,716; sh: 39; makefile: 20
file content (23 lines) | stat: -rwxr-xr-x 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

LAST_VER=$(git tag -l | tail -n 1)
CURR_VER=$(python -c 'import gdspy; print(gdspy.__version__)')

if [ "$LAST_VER" = "v$CURR_VER" ]; then
  echo "Version $CURR_VER (from package) already tagged. Did you forget to update __version__?"
  exit 1
fi

if ! grep "### Version $CURR_VER" README.md > /dev/null 2>&1; then
  echo "Version $CURR_VER not found in the release notes of README.md"
  exit 1
fi

echo "Release version $CURR_VER [y/n]?"
read -r GOON

if [ "$GOON" = 'y' ] ; then
  git commit -m "Release v$CURR_VER"
  git tag -am "Release v$CURR_VER" "v$CURR_VER"
  echo "Review the status and 'git push' to finish release"
fi