Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2335 from trufflesuite/distReleaseScript
Browse files Browse the repository at this point in the history
Internal improvement: Dist tag release script
  • Loading branch information
CruzMolina committed Aug 27, 2019
2 parents 433ae41 + 8367cc6 commit d0b177d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"bootstrap": "lerna bootstrap",
"prepare": "lerna run prepare --stream --concurrency=1",
"publish-release": "./scripts/publish-release.sh",
"publish-dist-tag": "./scripts/publish-dist-tag.sh",
"prepare-release": "./scripts/prepare-release.sh",
"test": "lerna run test --stream --concurrency=1 -- --colors",
"ci": "./scripts/ci.sh",
Expand Down
25 changes: 25 additions & 0 deletions scripts/publish-dist-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# The below tells bash to stop the script if any of the commands fail
set -ex

distTag=$1 # first arg after yarn publish-dist-tag
currentGitBranch=$(git rev-parse --abbrev-ref HEAD)

if [ "${distTag}" == "" ];
then
echo "No tag name given!"
exit 1
fi

echo "Publishing \"truffle@${distTag}\" from \"${currentGitBranch}\" branch."
npm login
node ./scripts/npm-access.js
lerna version --no-git-tag-version --preid $distTag
git add .
git commit -m "Publish truffle@${distTag}"
lerna publish from-package --dist-tag ${distTag}
git push origin $currentGitBranch
npm un -g truffle
npm i -g truffle@${distTag}
echo -e "\\n\\nWoo!"

0 comments on commit d0b177d

Please sign in to comment.