1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-15 03:35:16 +00:00

Refactor the deploy process a bit

This commit is contained in:
Nathan Downs 2019-07-01 15:02:12 -07:00
parent c536f2c3d8
commit c594d51bc7
2 changed files with 7 additions and 9 deletions

View File

@ -33,11 +33,10 @@
"module": "./dist/twemoji.esm.js", "module": "./dist/twemoji.esm.js",
"unpkg": "./dist/twemoji.min.js", "unpkg": "./dist/twemoji.min.js",
"scripts": { "scripts": {
"version": "yarn version",
"build": "./scripts/generate", "build": "./scripts/generate",
"test": "phantomjs ./src/test/testrunner.js", "test": "phantomjs ./src/test/testrunner.js",
"deploy": "./scripts/deploy.sh gh-pages", "deploy": "./scripts/deploy.sh gh-pages",
"prepublishOnly": "run-s version build test deploy" "prepublishOnly": "run-s build test deploy"
}, },
"dependencies": { "dependencies": {
"fs-extra": "^8.0.1", "fs-extra": "^8.0.1",

View File

@ -1,16 +1,14 @@
#!/bin/bash #!/bin/bash
ROOT=$( ROOT=$(
cd $(dirname $0)/.. cd $(dirname $0)/..
/bin/pwd /bin/pwd
) )
OUT="$ROOT/dist/" DIST="$ROOT/dist/"
PUBLISH_BRANCH=$1 PUBLISH_BRANCH=$1
# For this to work, the version specification must be on the second line of package.json VERSION=$(cat package.json | jq -r .version)
VERSION=$(cat "$ROOT/package.json" | sed '2!d' | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')
git fetch --all git fetch --all
git add -f $OUT
git checkout $PUBLISH_BRANCH git checkout $PUBLISH_BRANCH
git pull origin $PUBLISH_BRANCH git pull origin $PUBLISH_BRANCH
cd "v/" cd "v/"
@ -19,8 +17,9 @@ if [ -d $VERSION ]; then
rm -r $VERSION rm -r $VERSION
fi fi
# Create new version folder out of dist/ # Create new version folder out of dist/
git mv -f $OUT $VERSION mv -f $DIST $VERSION
git commit -q -m "Update the Twemoji project and push to $PUBLISH_BRANCH" git add $VERSION
git commit -q -m "Publish v$VERSION"
git push origin $PUBLISH_BRANCH git push origin $PUBLISH_BRANCH
# Return to your working branch # Return to your working branch
git checkout - git checkout -