2019-07-18 07:51:47 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
if [[ "${CI:-}" != 'true' ]]
|
|
|
|
then
|
|
|
|
printf '%s\n' 'CI environment variable must be set to true'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${CIRCLECI:-}" != 'true' ]]
|
|
|
|
then
|
|
|
|
printf '%s\n' 'CIRCLECI environment variable must be set to true'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf '%s\n' 'Updating the manifest version if needed'
|
|
|
|
|
|
|
|
version="${CIRCLE_BRANCH/Version-v/}"
|
2020-06-01 23:07:27 +02:00
|
|
|
updated_manifest="$(jq ".version = \"$version\"" app/manifest/_base.json)"
|
|
|
|
printf '%s\n' "$updated_manifest" > app/manifest/_base.json
|
2020-10-06 19:57:59 +02:00
|
|
|
yarn prettier --write app/manifest/_base.json
|
2019-07-18 07:51:47 +02:00
|
|
|
|
|
|
|
if [[ -z $(git status --porcelain) ]]
|
|
|
|
then
|
|
|
|
printf '%s\n' 'App manifest version already set'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
git \
|
|
|
|
-c user.name='MetaMask Bot' \
|
|
|
|
-c user.email='metamaskbot@users.noreply.github.com' \
|
|
|
|
commit --message "${CIRCLE_BRANCH/-/ }" \
|
2020-06-01 23:07:27 +02:00
|
|
|
CHANGELOG.md app/manifest/_base.json
|
2019-07-18 07:51:47 +02:00
|
|
|
|
|
|
|
repo_slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
|
|
|
|
git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" "$CIRCLE_BRANCH"
|