Skip to content

Commit 50778c6

Browse files
authored
chore: set up nightly builds with github actions (#26682)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR adds GitHub Actions as a parallel nightly build system alongside Bitrise, enabling a gradual deprecation of Bitrise for nightly builds. **Why**: The team wants to migrate nightly builds from Bitrise to GitHub Actions. To do this safely, both systems need to run in parallel for a testing/validation period before Bitrise is turned off. **What changed**: - **`build.yml`**: Added an optional `skip_version_bump` boolean input (default: `false`). When `true`, the `update-build-version` job is skipped and the build runs against the current HEAD of the branch. This is needed because Bitrise already owns the version bump for `chore/temp-nightly` (via its `bump_version_code` workflow, which dispatches `update-latest-build-version.yml` via the GitHub API). Without this flag, both systems would race to bump the version concurrently on the same branch. The `prepare` and `build` jobs use `always() && !failure() && !cancelled()` to correctly handle a skipped (not failed) `update-build-version` dependency. - **`nightly-build.yml`** (new): A dedicated workflow that triggers on every push to `chore/temp-nightly` — the same event that triggers Bitrise via its dashboard webhook. It runs `main-exp` and `main-rc` builds for both platforms in parallel, mirroring Bitrise's `nightly_exp_builds_pipeline` and `nightly_rc_builds_pipeline`. `[skip ci]` commits (written back to the branch by Bitrise's version bump) are automatically ignored by GitHub Actions, preventing any re-trigger loop. A `workflow_dispatch` trigger is also included for manual testing from any branch. **Transition path**: When Bitrise is deprecated, remove `skip_version_bump: true` from `nightly-build.yml` and GitHub Actions will take over the version bump as well. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes CI control flow (skipped dependencies, conditional checkouts) and adds a new automated nightly trigger, which could impact build reproducibility and job execution if misconfigured. > > **Overview** > Adds a `skip_version_bump` input to `.github/workflows/build.yml` to optionally skip `update-build-version`, adjust downstream `prepare`/`build` job gating to tolerate skipped dependencies, and conditionally build from either the bumped commit or the branch HEAD. > > Introduces a new `.github/workflows/nightly-build.yml` that runs nightly `main-exp` and `main-rc` builds for both platforms on pushes to `chore/temp-nightly`, calling `build.yml` with `skip_version_bump: true` for parallel operation alongside Bitrise. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e426099. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 48275cf commit 50778c6

2 files changed

Lines changed: 59 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
platform:
1010
required: true
1111
type: string # android, ios, or both
12+
skip_version_bump:
13+
required: false
14+
type: boolean
15+
default: false
1216
workflow_dispatch:
1317
inputs:
1418
build_name:
@@ -32,14 +36,20 @@ on:
3236
required: true
3337
type: choice
3438
options: [android, ios, both]
39+
skip_version_bump:
40+
required: false
41+
type: boolean
42+
default: false
3543

3644
permissions:
3745
contents: read
3846
id-token: write
3947

4048
jobs:
41-
# Bump version in repo (bitrise.yml, package.json, ios/android) before building
49+
# Bump version in repo (bitrise.yml, package.json, ios/android) before building.
50+
# Skipped when skip_version_bump=true (e.g. nightly builds where Bitrise owns the bump).
4251
update-build-version:
52+
if: ${{ !inputs.skip_version_bump }}
4353
uses: ./.github/workflows/update-latest-build-version.yml
4454
permissions:
4555
contents: write
@@ -52,6 +62,7 @@ jobs:
5262
# Load config
5363
prepare:
5464
needs: [update-build-version]
65+
if: ${{ always() && !failure() && !cancelled() }}
5566
runs-on: ubuntu-latest
5667
outputs:
5768
github_environment: ${{ steps.config.outputs.github_environment }}
@@ -86,6 +97,7 @@ jobs:
8697
# Build
8798
build:
8899
needs: [prepare, update-build-version]
100+
if: ${{ always() && !failure() && !cancelled() }}
89101
strategy:
90102
matrix:
91103
platform: ${{ inputs.platform == 'both' && fromJSON('["android", "ios"]') || fromJSON(format('["{0}"]', inputs.platform)) }}
@@ -94,6 +106,7 @@ jobs:
94106
environment: ${{ needs.prepare.outputs.github_environment }}
95107
steps:
96108
- name: Validate version-bump commit
109+
if: ${{ !inputs.skip_version_bump }}
97110
run: |
98111
COMMIT_HASH="${{ needs.update-build-version.outputs.commit-hash }}"
99112
if [ -z "$COMMIT_HASH" ]; then
@@ -102,8 +115,11 @@ jobs:
102115
fi
103116
echo "Building at version-bump commit: $COMMIT_HASH"
104117
- uses: actions/checkout@v4
118+
if: ${{ !inputs.skip_version_bump }}
105119
with:
106120
ref: ${{ needs.update-build-version.outputs.commit-hash }}
121+
- uses: actions/checkout@v4
122+
if: ${{ inputs.skip_version_bump }}
107123
- uses: actions/setup-node@v4
108124
with:
109125
node-version: '20'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Nightly Build
2+
3+
# Triggered by every push to chore/temp-nightly (which nightly-temp-branch-sync.yml
4+
# force-pushes daily at 4 AM UTC to match main).
5+
#
6+
# [skip ci] commits (e.g. version bumps pushed by Bitrise's bump_version_code job via
7+
# update-latest-build-version.yml) are automatically skipped by GitHub Actions, so
8+
# this workflow will NOT double-trigger on those commits.
9+
#
10+
# skip_version_bump=true is passed to build.yml because Bitrise already owns the
11+
# version bump for chore/temp-nightly during the parallel transition period.
12+
# When Bitrise is deprecated, remove skip_version_bump: true and the version bump
13+
# will be handled by build.yml as normal.
14+
15+
on:
16+
push:
17+
branches:
18+
- chore/temp-nightly
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
id-token: write
24+
25+
jobs:
26+
build-exp:
27+
name: Nightly exp build (main-exp)
28+
uses: ./.github/workflows/build.yml
29+
with:
30+
build_name: main-exp
31+
platform: both
32+
skip_version_bump: true
33+
secrets: inherit
34+
35+
build-rc:
36+
name: Nightly RC build (main-rc)
37+
uses: ./.github/workflows/build.yml
38+
with:
39+
build_name: main-rc
40+
platform: both
41+
skip_version_bump: true
42+
secrets: inherit

0 commit comments

Comments
 (0)