-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·39 lines (31 loc) · 926 Bytes
/
release.sh
File metadata and controls
executable file
·39 lines (31 loc) · 926 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
32
33
34
35
36
37
38
39
#!/bin/bash
VERSION_INC=./src/version.inc
VERSION=`cat $VERSION_INC | cut -d '=' -f 2` # VERSION=x.x.x
PREFIX=raphnet-tech_adapter_manager
HEXFILE=$PREFIX.hex
TAG=v$VERSION
echo "Release script for $PREFIX"
if [ $# -ne 1 ]; then
echo "Syntax: ./release.sh releasedir"
echo
echo "ex: './release.sh ../releases' will produce $PREFIX-$VERSION.tar.gz in releasedir out of git HEAD,"
echo "and place it in the ../releases directory."
echo
echo "It will also create a tag named $TAG"
exit
fi
RELEASEDIR=$1
DIRNAME=$PREFIX-$VERSION
FILENAME=$PREFIX-$VERSION.tar.gz
echo "Version: $VERSION"
echo "Filename: $FILENAME"
echo "Release directory: $RELEASEDIR"
echo "--------"
echo "Ready? Press ENTER to go ahead (or CTRL+C to cancel)"
read
if [ -f $RELEASEDIR/$FILENAME ]; then
echo "Release file already exists!"
exit 1
fi
git tag $TAG -f
git archive --format=tar --prefix=$DIRNAME/ HEAD | gzip > $RELEASEDIR/$FILENAME