-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: point dev to builds.yml #27036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,12 +209,18 @@ loadBuildConfig() { | |
| # Legacy env remapping (Bitrise). Used only when GITHUB_ACTIONS is not set. | ||
| # GitHub Actions uses loadBuildConfig + builds.yml; secrets are set with canonical names. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # Remap Bitrise-style vars (*_DEV, *_QA, *_PROD) to canonical names. Skip when source is unset | ||
| # (local / builds.yml use canonical names in .js.env; no _DEV/_QA needed). | ||
| # Legacy path (not GHA, not builds.yml): missing source var fails fast. Local: set BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY in .js.env to use builds.yml and skip. | ||
| remapEnvVariable() { | ||
| local old_var_name="$1" | ||
| local new_var_name="$2" | ||
| if [ -z "${!old_var_name}" ]; then | ||
| echo "Error: $old_var_name does not exist in the environment." | ||
| return 1 | ||
| if [ -z "${GITHUB_ACTIONS:-}" ] && [ "${BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY:-false}" != "true" ]; then | ||
| echo "❌ Required Bitrise secret is missing: $old_var_name" | ||
| return 1 | ||
| fi | ||
| return 0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return 0 is a silent failure risk on Bitrise. If a secret is ever misconfigured there, the build will pass and ship broken instead of failing fast The proper fix would have been to distinguish Bitrise from local, e.g. using a BITRISE_IO env var (which Bitrise sets automatically): Or maybe cleaner
cursor[bot] marked this conversation as resolved.
|
||
| fi | ||
| export $new_var_name="${!old_var_name}" | ||
| unset $old_var_name | ||
|
|
@@ -984,8 +990,10 @@ checkParameters "$@" | |
| printTitle | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # Load build configuration: GitHub Actions uses builds.yml; Bitrise uses legacy remap. | ||
| # Both paths supported until Bitrise is deprecated. | ||
| # Load build configuration. Gated by BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY: | ||
| # true = GHA (set by workflow) and local (set in .js.env) → use builds.yml | ||
| # false = Bitrise (unset) → skip builds.yml, use legacy remap only | ||
| # Local: .js.env is applied after loadBuildConfig so it overrides (see below). | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| if [ "$PLATFORM" != "expo-update" ]; then | ||
| # Set flags for main builds | ||
|
|
@@ -994,14 +1002,30 @@ if [ "$PLATFORM" != "expo-update" ]; then | |
| export PRE_RELEASE=true # Used mostly for iOS, for Android only deletes old APK and installs new one | ||
| fi | ||
|
|
||
| if [ -n "${GITHUB_ACTIONS:-}" ]; then | ||
| # GitHub Actions: config from builds.yml (Apply build config step sets env; loadBuildConfig fills any gaps) | ||
| if ! loadBuildConfig "$METAMASK_BUILD_TYPE" "$METAMASK_ENVIRONMENT"; then | ||
| # Non-GHA: source .js.env early so BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY is set for the gate (local can opt in) | ||
| if [ -z "${GITHUB_ACTIONS:-}" ] && [ -e "$JS_ENV_FILE" ]; then | ||
| source "$JS_ENV_FILE" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-sourcing
|
||
| fi | ||
|
|
||
| BUILD_TYPE_FOR_CONFIG=$(echo "$METAMASK_BUILD_TYPE" | tr '[:upper:]' '[:lower:]') | ||
| if [ "${BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY:-false}" = "true" ]; then | ||
| # builds.yml path: GHA or local with flag. | ||
| if ! loadBuildConfig "$BUILD_TYPE_FOR_CONFIG" "$METAMASK_ENVIRONMENT"; then | ||
| echo "❌ Build configuration failed. Exiting." | ||
| exit 1 | ||
| fi | ||
| else | ||
| # Bitrise (or local): legacy env remapping (Bitrise secrets use per-env names, e.g. SEGMENT_WRITE_KEY_PROD) | ||
| echo "⚠️ BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY is not true; skipping builds.yml, using legacy remap / .js.env" | ||
| echo "" | ||
| fi | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| # Local builds: .js.env overrides builds.yml (takes precedence) | ||
| if [ -z "${GITHUB_ACTIONS:-}" ] && [ -e "$JS_ENV_FILE" ]; then | ||
| source "$JS_ENV_FILE" | ||
| fi | ||
|
|
||
| # Bitrise (or other non-GHA CI): legacy env remapping (secrets use per-env names, e.g. SEGMENT_WRITE_KEY_PROD) | ||
| if [ -z "${GITHUB_ACTIONS:-}" ]; then | ||
| if [ "$METAMASK_BUILD_TYPE" == "main" ]; then | ||
| if [ "$METAMASK_ENVIRONMENT" == "production" ]; then | ||
| remapMainProdEnvVariables | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DO we want to keep the api url at AppInformation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be good for awhile to test - this is listed in Builds.yml so it should not be a secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to remove it though if you don't think it's needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!