File: publish-package.sh

package info (click to toggle)
libjs-chosen 1.8.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 756 kB
  • sloc: sh: 28; makefile: 13
file content (41 lines) | stat: -rwxr-xr-x 1,106 bytes parent folder | download | duplicates (2)
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
40
41
#!/bin/sh

set -e

CURRENT_BRANCH=`git name-rev --name-only HEAD`

if [ $CURRENT_BRANCH != 'master' ] ; then
  echo "Build not on master. Skipped chosen-package release"
  exit 0
fi

CHOSEN_VERSION=`git tag --sort=v:refname | tail -1`
GITHUB_URL=https://pfiller:${GH_TOKEN}@github.com/harvesthq/chosen-package.git

git clone $GITHUB_URL
rm -rf chosen-package/*
cp README.md public/*.json public/*.png public/*.js public/*.css public/LICENSE* chosen-package/
cp package-travis.yml chosen-package/.travis.yml
cd chosen-package

git config user.email "chosen@getharvest.com"
git config user.name "chosen-package"

LATEST_VERSION=`git tag --sort=v:refname | tail -1`

git remote set-url origin $GITHUB_URL

git add -A
git commit -m "Chosen build to chosen-package"

if [ "$LATEST_VERSION" = "$CHOSEN_VERSION" ] ; then
  echo "No Chosen version change. Skipped tagging"
else
  echo "Chosen version changed. Tagging version ${CHOSEN_VERSION}\n"
  git tag -a "${CHOSEN_VERSION}" -m "Version ${CHOSEN_VERSION}"
fi

git push origin master
git push origin --tags

echo "Chosen published to harvesthq/chosen-package"