forked from milliams/plotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·27 lines (20 loc) · 762 Bytes
/
release.sh
File metadata and controls
executable file
·27 lines (20 loc) · 762 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
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
[[ -n ${1+x} ]] || (echo "Usage: release.sh <version number>" && exit 1)
version=$1
date=$(date --iso-8601)
echo -e "\\n# Checking version number\\n"
git fetch
git tag --list | grep -q "${version}" && echo "Error: Git tag ${version} already exists" && exit 1
echo -e "\\n# Updating version number in files\\n"
sed --in-place "s/version = \".*\"/version = \"${version}\"/" Cargo.toml
sed --in-place "s/## Unreleased/## Unreleased\\n\\n## ${version} - ${date}/" CHANGELOG
echo -e "\\n# Adding to Git\\n"
git add Cargo.toml CHANGELOG
git commit -m "Update version numbers for ${version}"
echo -e "\\n# Pushing to Git\\n"
git tag "${version}"
git push origin
git push origin --tags
echo -e "\\n# Success ✓"