-
Notifications
You must be signed in to change notification settings - Fork 32
/
publish.sh
executable file
·31 lines (31 loc) · 1.44 KB
/
publish.sh
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
cd $TRAVIS_BUILD_DIR
export PACKAGE_VERSION=$(node -p "require('./package.json').version")
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
if [[ "$TRAVIS_COMMIT_MESSAGE" =~ ^[\ []Release[]\ ].*$ ]]; then
export SHOULD_BUILD=true
export TRAVIS_TAG="v${PACKAGE_VERSION}"
echo $TRAVIS_TAG > travis_tag
echo "Beet Installer ${TRAVIS_TAG}" > release_name
echo "This is the official Beet v${PACKAGE_VERSION} release." > release_desc
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" =~ ^[\ []RC[]\ ].*$ ]]; then
export SHOULD_BUILD="true"
export TRAVIS_TAG="v${PACKAGE_VERSION}-rc-${TRAVIS_COMMIT}"
echo $TRAVIS_TAG > travis_tag
echo "Release Candidate: v${PACKAGE_VERSION}-rc-${TRAVIS_COMMIT}" > release_name
echo "This is a Release Candidate Beet build. Contains new features but may also contain bugs." > release_desc
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" =~ ^[\ []Test[]\ ].*$ ]]; then
export SHOULD_BUILD=true
export TRAVIS_TAG="v${PACKAGE_VERSION}-dev-${TRAVIS_COMMIT}"
echo $TRAVIS_TAG > travis_tag
echo "Test Release: v${PACKAGE_VERSION}-dev-${TRAVIS_COMMIT}" > release_name
echo "This is a test development Beet build. Not for production use." > release_desc
fi
if [ "$SHOULD_BUILD" = "true" ]; then
git remote rm origin
git remote add origin https://github.com:${GH_TOKEN}@github.com/bitshares/beet.git > /dev/null 2>&1
git tag $TRAVIS_TAG
git push origin $TRAVIS_TAG
fi