diff --git a/package.json b/package.json index 36771c58..5eb3493f 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,10 @@ "module": "./dist/twemoji.esm.js", "unpkg": "./dist/twemoji.min.js", "scripts": { - "version": "yarn version", "build": "./scripts/generate", "test": "phantomjs ./src/test/testrunner.js", "deploy": "./scripts/deploy.sh gh-pages", - "prepublishOnly": "run-s version build test deploy" + "prepublishOnly": "run-s build test deploy" }, "dependencies": { "fs-extra": "^8.0.1", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index fe1248d7..2f76547e 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,16 +1,14 @@ -#!/bin/bash +#!/bin/bash ROOT=$( cd $(dirname $0)/.. /bin/pwd ) -OUT="$ROOT/dist/" +DIST="$ROOT/dist/" PUBLISH_BRANCH=$1 -# For this to work, the version specification must be on the second line of package.json -VERSION=$(cat "$ROOT/package.json" | sed '2!d' | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') +VERSION=$(cat package.json | jq -r .version) git fetch --all -git add -f $OUT git checkout $PUBLISH_BRANCH git pull origin $PUBLISH_BRANCH cd "v/" @@ -19,8 +17,9 @@ if [ -d $VERSION ]; then rm -r $VERSION fi # Create new version folder out of dist/ -git mv -f $OUT $VERSION -git commit -q -m "Update the Twemoji project and push to $PUBLISH_BRANCH" +mv -f $DIST $VERSION +git add $VERSION +git commit -q -m "Publish v$VERSION" git push origin $PUBLISH_BRANCH # Return to your working branch git checkout -