aboutsummaryrefslogtreecommitdiffstats
path: root/release-commit.sh
blob: f05bde207d0a689836b781ce4ee29a5c54230420 (plain)
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
32
33
34
#!/usr/bin/env bash

function catch_errors() {
  echo "ERROR. That's life."
  exit 1
}

trap catch_errors ERR

TMP_FILE='changelog.tmp'
CHANGELOG_FILE='CHANGELOG.md'

echo "Getting current version..."
VERSION=`./version.js --current`

echo "Generating changelog..."
./changelog.js $VERSION $TMP_FILE

cat $CHANGELOG_FILE >> $TMP_FILE
mv -f $TMP_FILE $CHANGELOG_FILE


echo "Updating version..."
./version.js --remove-snapshot

echo "CONFIRM TO COMMIT"
read WHATEVER


echo "Creating commit..."
git commit version.yaml CHANGELOG.md -m "chore(relase): cutting the v$VERSION release"

echo "Creating tag..."
git tag "v$VERSION"