Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Push precompiled to correct branch (v1) (#7031)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Nov 13, 2017
1 parent 6997ddd commit 1749dd8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 40 deletions.
26 changes: 12 additions & 14 deletions js-old/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ set -e

# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
PACKAGES=( "parity" "etherscan" "shapeshift" "jsonrpc" )
BRANCH="v1"
PRECOMPILED_BRANCH="v1"
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git"
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"

Expand All @@ -23,56 +22,55 @@ pushd $BASEDIR
cd ../.dist

# add local files and send it up
echo "*** Setting up GitHub config for js-precompiled"
echo "*** [v1] Setting up GitHub config for js-precompiled"
rm -rf ./.git
git init
setup_git_user

echo "*** Checking out $BRANCH branch"
echo "*** [v1] Checking out $PRECOMPILED_BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $BRANCH
git checkout -b $PRECOMPILED_BRANCH

echo "*** Committing compiled files for $UTCDATE"
echo "*** [v1] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
git merge origin/$BRANCH -X ours --commit -m "$UTCDATE [merge]"
git merge origin/$PRECOMPILED_BRANCH -X ours --commit -m "$UTCDATE [merge]"
git rm -r build
rm -rf build
git commit -m "$UTCDATE [cleanup]"
mv ../build.new build
git add .
git commit -m "$UTCDATE [release]"

echo "*** Merging remote"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
echo "*** [v1] Merging remote"
git push origin HEAD:refs/heads/$PRECOMPILED_BRANCH 2>$GITLOG
PRECOMPILED_HASH=`git rev-parse HEAD`

# move to root
cd ../..

echo "*** Setting up GitHub config for parity"
echo "*** [v1] Setting up GitHub config for parity"
setup_git_user
git remote set-url origin $GIT_PARITY
git reset --hard origin/$BRANCH 2>$GITLOG

echo "*** Updating cargo parity-ui-old-precompiled#$PRECOMPILED_HASH"
echo "*** [v1] Updating cargo parity-ui-old-precompiled#$PRECOMPILED_HASH"
git submodule update
# Not needed since $BRANCH is hardcoded
# sed -i "/^parity-ui-old-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-old-precompiled
# --precise "$PRECOMPILED_HASH"

echo "*** Committing updated files"
git add js
echo "*** [v1] Committing updated files"
git add dapps/ui/Cargo.toml
git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG

# back to root
echo "*** Release completed"
echo "*** [v1] Release completed"
popd

# exit with exit code
Expand Down
34 changes: 9 additions & 25 deletions js/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -e

# variables
UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
PACKAGES=()
BRANCH=$CI_BUILD_REF_NAME
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git"
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
Expand All @@ -23,17 +22,17 @@ pushd $BASEDIR
cd ../.dist

# add local files and send it up
echo "*** Setting up GitHub config for js-precompiled"
echo "*** [v2] Setting up GitHub config for js-precompiled"
rm -rf ./.git
git init
setup_git_user

echo "*** Checking out $BRANCH branch"
echo "*** [v2] Checking out $BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $BRANCH

echo "*** Committing compiled files for $UTCDATE"
echo "*** [v2] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
Expand All @@ -45,58 +44,43 @@ mv ../build.new build
git add .
git commit -m "$UTCDATE [release]"

echo "*** Merging remote"
echo "*** [v2] Merging remote"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG
PRECOMPILED_HASH=`git rev-parse HEAD`

# move to root
cd ../..

echo "*** Setting up GitHub config for parity"
echo "*** [v2] Setting up GitHub config for parity"
setup_git_user
git remote set-url origin $GIT_PARITY
git reset --hard origin/$BRANCH 2>$GITLOG

if [ "$BRANCH" == "master" ]; then
cd js

echo "*** Bumping package.json patch version"
echo "*** [v2] Bumping package.json patch version"
npm --no-git-tag-version version
npm version patch

echo "*** Building packages for npmjs"
echo "$NPM_TOKEN" >> ~/.npmrc

for PACKAGE in ${PACKAGES[@]}
do
echo "*** Building $PACKAGE"
LIBRARY=$PACKAGE npm run ci:build:npm
DIRECTORY=.npmjs/$PACKAGE

echo "*** Publishing $PACKAGE from $DIRECTORY"
cd $DIRECTORY
npm publish --access public || true
cd ../..
done

cd ..
fi

echo "*** Updating cargo parity-ui-precompiled#$PRECOMPILED_HASH"
echo "*** [v2] Updating cargo parity-ui-precompiled#$PRECOMPILED_HASH"
git submodule update
sed -i "/^parity-ui-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-precompiled
# --precise "$PRECOMPILED_HASH"

echo "*** Committing updated files"
echo "*** [v2] Committing updated files"
git add js
git add dapps/ui/Cargo.toml
git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG

# back to root
echo "*** Release completed"
echo "*** [v2] Release completed"
popd

# exit with exit code
Expand Down
2 changes: 1 addition & 1 deletion js/scripts/test.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// test script 14
// test script 15

0 comments on commit 1749dd8

Please sign in to comment.