bpmn-js/tasks/stages/publish-prebuilt

36 lines
907 B
Bash
Executable File

#! /bin/bash
# publishes the bower-bpmn-js prebuilt bundle
PWD="$(pwd)"
WORKDIR="$(pwd)/tmp"
BOWER_DIR="$WORKDIR/bower-bpmn-js"
# create work dir
mkdir -p "$WORKDIR"
git clone --depth=1 https://github.com/bpmn-io/bower-bpmn-js.git "$BOWER_DIR"
npm install
BOWER_DIST="$BOWER_DIR/dist" npm run distro
cd "$BOWER_DIR"
git config user.email "$BPMN_IO_EMAIL"
git config user.name "$BPMN_IO_USERNAME"
git config push.default simple
# update bower.json
BOWER_VERSION="${TRAVIS_TAG:1}"
echo "Updating bower.json version to $BOWER_VERSION"
sed -i -E "s/(\"version\": )\"[^\"]+\"/\1\"$BOWER_VERSION\"/" bower.json
# add all resources
git add -A
git commit -m "chore(project): package $TRAVIS_TAG"
git tag "$TRAVIS_TAG"
git push -q "https://$GITHUB_AUTH@github.com/bpmn-io/bower-bpmn-js.git" &2>/dev/null
git push --tags -q "https://$GITHUB_AUTH@github.com/bpmn-io/bower-bpmn-js.git" &2>/dev/null
cd "$PWD"