Skip to content

Commit

Permalink
improve publish system
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Jan 25, 2019
1 parent 2b6b9fb commit 22e7837
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ tmp
node_modules
npm-debug.log
package-lock.json

# temporary
bin/publish-release-all.sh
37 changes: 26 additions & 11 deletions bin/publish-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ cd "`dirname $0`/.."

./bin/require-clean-working-tree.sh

package="$1"
package="$1" # a short name like 'core'
version="$2"
scope="$3"
release_tag="$3"
production_str="$4"

if [[ ! "$package" ]]
then
Expand All @@ -24,16 +25,31 @@ then
exit 1
fi

if [[ "$scope" != "latest" ]] && [[ "$scope" != "beta" ]] && [[ "$scope" != "alpha" ]]
if [[ "$release_tag" != "latest" ]] && [[ "$release_tag" != "beta" ]] && [[ "$release_tag" != "alpha" ]]
then
echo "Invalid third argument scope '$scope'. Aborting."
echo "Invalid third argument scope '$release_tag'. Aborting."
exit 1
fi

# # push the current branch (assumes tracking is set up) and the tag
# git push --recurse-submodules=on-demand
# git push origin "v$version"
echo "REENABLE BRANCH PUSHING"
if [[ "$production_str" == "" ]]
then
is_production="0"
npm_registry_str="--registry http://localhost:4873"
elif [[ "$production_str" == "--production" ]]
then
is_production="1"
npm_registry_str=""
else
echo "Invalid flag $production_str. Aborting"
exit 1
fi

if [[ "$is_production" == "1" ]]
then
# push the current branch (assumes tracking is set up) and the tag
git push --recurse-submodules=on-demand
git push origin "v$version"
fi

if {
# check out dist files for tag but don't stage them
Expand All @@ -42,11 +58,10 @@ if {

cd "dist/$package" &&

# npm publish --tag "$scope"
echo "FAKE NPM PUBLISH ($PWD)" &&
ls -al
npm publish --tag "$release_tag" "$npm_registry_str"
}
then
ls -al
echo 'Success.'
else
echo 'Failure.'
Expand Down

0 comments on commit 22e7837

Please sign in to comment.