2021-01-22 13:21:37 +00:00
|
|
|
#!/bin/bash
|
2018-02-06 11:05:48 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
2021-04-30 16:07:17 +00:00
|
|
|
git clone --depth=1 "https://$GH_AUTH@github.com/bpmn-io/bpmn-js-examples.git" "$EXAMPLES_DIR"
|
2018-02-06 11:05:48 +00:00
|
|
|
|
|
|
|
cd "$EXAMPLES_DIR"
|
|
|
|
|
2021-04-30 16:07:17 +00:00
|
|
|
TOOLKIT_VERSION="${TAG:1}"
|
2018-02-06 11:05:48 +00:00
|
|
|
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
|
2021-04-30 16:07:17 +00:00
|
|
|
git commit -m "chore: bump examples to $TAG"
|
|
|
|
git tag "$TAG"
|
2020-02-04 08:30:43 +00:00
|
|
|
git push -q &2>/dev/null
|
|
|
|
git push --tags -q &2>/dev/null
|
2018-02-06 11:05:48 +00:00
|
|
|
else
|
|
|
|
echo "Skipping commit (SKIP_COMMIT=$SKIP_COMMIT)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$PWD"
|