chore(ci): update examples during release

This commit is contained in:
Nico Rehwaldt 2018-02-06 12:05:48 +01:00
parent 68bfa10351
commit 37d70a19ca
2 changed files with 43 additions and 0 deletions

View File

@ -23,8 +23,12 @@ jobs:
- TEST_BROWSERS=Firefox,PhantomJS npm run all
- stage: update integration test
script: './tasks/stages/update-integration-test'
- stage: update examples
script: './tasks/stages/update-examples'
stages:
- test
- name: update integration test
if: tag =~ ^v\d
- name: update examples
if: tag =~ ^v\d

39
tasks/stages/update-examples Executable file
View File

@ -0,0 +1,39 @@
#! /bin/bash
# update bpmn-js version in the <bpmn-js-examples> project
PWD="$(pwd)"
WORKDIR="$(pwd)/tmp"
EXAMPLES_DIR="$WORKDIR/bpmn-js-examples"
# create work dir
mkdir -p "$WORKDIR"
git clone --depth=1 https://github.com/bpmn-io/bpmn-js-examples.git "$EXAMPLES_DIR"
cd "$EXAMPLES_DIR"
# update bower.json
TOOLKIT_VERSION="${TRAVIS_TAG:1}"
echo "Updating toolkit version to $TOOLKIT_VERSION"
sed -i -E "s#(\"bpmn-js\": )\"[^\"]+\"#\1\"^$TOOLKIT_VERSION\"#" **/package.json
sed -i -E "s#/bpmn-js@[^/]+/#/bpmn-js@$TOOLKIT_VERSION/#" **/*.{html,md}
if [[ "x$SKIP_COMMIT" = "x" ]]; then
git config user.email "$BPMN_IO_EMAIL"
git config user.name "$BPMN_IO_USERNAME"
git config push.default simple
# add all resources
git add -A
git commit -m "chore(project): bump examples to $TRAVIS_TAG"
git tag "$TRAVIS_TAG"
git push -q "https://$GITHUB_AUTH@github.com/bpmn-io/bpmn-js-examples.git" &2>/dev/null
git push --tags -q "https://$GITHUB_AUTH@github.com/bpmn-io/bpmn-js-examples.git" &2>/dev/null
else
echo "Skipping commit (SKIP_COMMIT=$SKIP_COMMIT)"
fi
cd "$PWD"