-
Notifications
You must be signed in to change notification settings - Fork 400
/
build.sh
executable file
·26 lines (22 loc) · 789 Bytes
/
build.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
SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)
TAG_TEST="^refs/tags/v.+$"
LATEST_TEST="^[^-]*$"
if [[ $GITHUB_REF =~ $TAG_TEST ]]; then
OVERRIDE_VERSION=${GITHUB_REF/refs\/tags\/v/}
if [[ $OVERRIDE_VERSION =~ $LATEST_TEST ]]; then
NPM_TAG=latest
else
NPM_TAG=next
fi;
else
OVERRIDE_VERSION=$(node -e "console.log(require('./package.json').version)")-exp.$SHORT_SHA
NPM_TAG=exp
fi;
npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION
npm run build
TARBALL=$(npm pack . | tail -n 1)
mv $TARBALL reactfire.tgz
echo "npm publish \$(dirname \"\$0\")/reactfire.tgz --tag $NPM_TAG" > ./publish.sh
chmod +x ./publish.sh
echo "tar -xzvf \$(dirname \"\$0\")/reactfire.tgz && rsync -a package/ ./" > ./unpack.sh
chmod +x ./unpack.sh