-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into hydai/update_zh_TW_translation
- Loading branch information
Showing
2,049 changed files
with
156,054 additions
and
95,300 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
if ! git diff --exit-code | ||
then | ||
echo "Working tree dirty" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
IS_NON_FORK_DRAFT='false' | ||
|
||
if [[ -n $CIRCLE_PULL_REQUEST ]] && gh auth status | ||
then | ||
PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}" | ||
if [ -n "$PR_NUMBER" ] | ||
then | ||
IS_NON_FORK_DRAFT="$(gh pr view --json isDraft --jq '.isDraft' "$PR_NUMBER")" | ||
fi | ||
fi | ||
|
||
# Build query to see whether there are any "preview-like" packages in the manifest | ||
# A "preview-like" package is a `@metamask`-scoped package with a prerelease version that has no period. | ||
QUERY='.dependencies + .devDependencies' # Get list of all dependencies | ||
QUERY+=' | with_entries( select(.key | startswith("@metamask") ) )' # filter to @metamask-scoped packages | ||
QUERY+=' | to_entries[].value' # Get version ranges | ||
QUERY+=' | select(test("^\\d+\\.\\d+\\.\\d+-[^.]+$"))' # Get pinned versions where the prerelease part has no "." | ||
|
||
# Use `-e` flag so that exit code indicates whether any matches were found | ||
if jq -e "${QUERY}" < ./package.json | ||
then | ||
echo "Preview builds detected" | ||
HAS_PREVIEW_BUILDS='true' | ||
else | ||
echo "No preview builds detected" | ||
HAS_PREVIEW_BUILDS='false' | ||
fi | ||
|
||
if [[ $IS_NON_FORK_DRAFT == 'true' && $HAS_PREVIEW_BUILDS == 'true' ]] | ||
then | ||
# Use GitHub registry on draft PRs, allowing the use of preview builds | ||
echo "Installing with preview builds" | ||
METAMASK_NPM_REGISTRY=https://npm.pkg.github.com yarn --immutable | ||
else | ||
echo "Installing without preview builds" | ||
yarn --immutable | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,37 +26,42 @@ function install_github_cli () | |
popd | ||
} | ||
|
||
function print_flask_version () | ||
function print_build_version () | ||
{ | ||
local flask_filename | ||
flask_filename="$(find ./builds-flask -type f -name 'metamask-flask-chrome-*.zip' -exec basename {} .zip \;)" | ||
local build_type="${1}"; shift | ||
|
||
local flask_build_filename_prefix | ||
flask_build_filename_prefix='metamask-flask-chrome-' | ||
local flask_build_filename_prefix_size | ||
flask_build_filename_prefix_size="${#flask_build_filename_prefix}" | ||
local filename | ||
filename="$(find "./builds-${build_type}" -type f -name "metamask-${build_type}-chrome-*.zip" -exec basename {} .zip \;)" | ||
|
||
local build_filename_prefix | ||
build_filename_prefix="metamask-${build_type}-chrome-" | ||
local build_filename_prefix_size | ||
build_filename_prefix_size="${#build_filename_prefix}" | ||
|
||
# Use substring parameter expansion to remove the filename prefix, leaving just the version | ||
echo "${flask_filename:$flask_build_filename_prefix_size}" | ||
echo "${filename:$build_filename_prefix_size}" | ||
} | ||
|
||
function publish_flask_tag () | ||
|
||
function publish_tag () | ||
{ | ||
local flask_version="${1}"; shift | ||
local build_name="${1}"; shift | ||
local build_version="${1}"; shift | ||
|
||
git config user.email "[email protected]" | ||
git config user.name "MetaMask Bot" | ||
git tag -a "v${flask_version}" -m "Flask version ${flask_version}" | ||
git tag -a "v${build_version}" -m "${build_name} version ${build_version}" | ||
repo_slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" | ||
git push "https://$GITHUB_TOKEN@github.com/$repo_slug" "v${flask_version}" | ||
git push "https://$GITHUB_TOKEN@github.com/$repo_slug" "v${build_version}" | ||
} | ||
|
||
current_commit_msg=$(git show -s --format='%s' HEAD) | ||
|
||
if [[ $current_commit_msg =~ Version[-[:space:]](v[[:digit:]]+.[[:digit:]]+.[[:digit:]]+) ]] | ||
then | ||
tag="${BASH_REMATCH[1]}" | ||
flask_version="$(print_flask_version)" | ||
flask_version="$(print_build_version 'flask')" | ||
mmi_version="$(print_build_version 'mmi')" | ||
|
||
install_github_cli | ||
|
||
|
@@ -67,12 +72,15 @@ then | |
--attach builds/metamask-firefox-*.zip \ | ||
--attach builds-flask/metamask-flask-chrome-*.zip \ | ||
--attach builds-flask/metamask-flask-firefox-*.zip \ | ||
--attach builds-mmi/metamask-mmi-chrome-*.zip \ | ||
--attach builds-mmi/metamask-mmi-firefox-*.zip \ | ||
--message "Version ${tag##v}" \ | ||
--message "$release_body" \ | ||
--commitish "$CIRCLE_SHA1" \ | ||
"$tag" | ||
|
||
publish_flask_tag "${flask_version}" | ||
publish_tag 'Flask' "${flask_version}" | ||
publish_tag 'MMI' "${mmi_version}" | ||
else | ||
printf '%s\n' 'Version not found in commit message; skipping GitHub Release' | ||
exit 0 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.