2017-11-13 11:52:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# variables
|
2017-11-23 14:29:56 +01:00
|
|
|
PVER="1-9"
|
2017-11-13 11:52:34 +01:00
|
|
|
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
|
2018-03-13 09:44:49 +01:00
|
|
|
BRANCH="stable"
|
2017-11-13 11:52:34 +01:00
|
|
|
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
|
|
|
|
|
|
|
|
echo "*** [cargo] Setting up GitHub config for parity"
|
2017-11-23 14:29:56 +01:00
|
|
|
git config push.default simple
|
|
|
|
git config merge.ours.driver true
|
|
|
|
git config user.email "$GITHUB_EMAIL"
|
|
|
|
git config user.name "GitLab Build Bot"
|
|
|
|
git remote set-url origin $GIT_PARITY > /dev/null 2>&1
|
2018-01-05 17:00:28 +01:00
|
|
|
git checkout $BRANCH
|
2017-11-23 14:29:56 +01:00
|
|
|
git reset --hard origin/$BRANCH 2>/dev/null
|
2017-11-13 11:52:34 +01:00
|
|
|
git submodule update
|
|
|
|
|
|
|
|
if [ "$BRANCH" == "master" ]; then
|
|
|
|
cd js
|
|
|
|
|
|
|
|
echo "*** [cargo] Bumping package.json patch version"
|
|
|
|
npm --no-git-tag-version version
|
|
|
|
npm version patch
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
git add js
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "*** [cargo] Updating cargo parity-ui-precompiled"
|
2017-11-23 14:29:56 +01:00
|
|
|
sed -i "/^parity-ui-precompiled/ { s/git = \".*\"/git = \"https:\/\/github.com\/js-dist-paritytech\/parity-$BRANCH-$PVER-shell.git\"/g; }" dapps/ui/Cargo.toml
|
2017-11-13 11:52:34 +01:00
|
|
|
cargo update -p parity-ui-precompiled
|
2017-11-23 14:29:56 +01:00
|
|
|
|
|
|
|
echo "*** [cargo] Updating cargo parity-ui-old-precompiled"
|
|
|
|
sed -i "/^parity-ui-old-precompiled/ { s/git = \".*\"/git = \"https:\/\/github.com\/js-dist-paritytech\/parity-$BRANCH-$PVER-v1.git\"/g; }" dapps/ui/Cargo.toml
|
2017-11-13 11:52:34 +01:00
|
|
|
cargo update -p parity-ui-old-precompiled
|
|
|
|
|
|
|
|
echo "*** [cargo] Committing updated files"
|
|
|
|
git add dapps/ui/Cargo.toml
|
|
|
|
git add Cargo.lock
|
|
|
|
git commit -m "[ci skip] js-precompiled $UTCDATE"
|
2017-11-23 14:29:56 +01:00
|
|
|
git push origin HEAD:refs/heads/$BRANCH 2>/dev/null
|
2017-11-13 11:52:34 +01:00
|
|
|
|
|
|
|
# exit with exit code
|
|
|
|
exit 0
|