-
Notifications
You must be signed in to change notification settings - Fork 4k
[No QA] Hybrid App adhoc builds follow ups #55061
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
Merged
Julesssss
merged 9 commits into
Expensify:main
from
software-mansion-labs:jnowakow/adhoc-hybrid-follow-ups
Jan 21, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a15d731
Adhoc builds workflow follow up
jnowakow b088527
Let author of PR specify Mobile-Expensify placement
jnowakow 4201baf
Don't repeat request
jnowakow ac7b3ef
fix workflow
jnowakow 37fb883
fix workflow 2
jnowakow 11a5667
fix workflow 3
jnowakow ea80bcf
Correct app id when launching android from terminal
jnowakow ee64e14
Merge branch 'main' into jnowakow/adhoc-hybrid-follow-ups
jnowakow b1f9db6
Checkout to PR ref instead of branch that exist only in fork
jnowakow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,21 +1,17 @@ | ||
| name: Build and deploy hybird apps for testing | ||
| name: Build and deploy hybrid apps for testing | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| PULL_REQUEST_NUMBER: | ||
| description: Pull Request number for correct placement of apps | ||
| required: true | ||
| OLD_DOT_COMMIT: | ||
| description: The branch, tag or SHA to checkout on Old Dot side | ||
| required: false | ||
| pull_request_target: | ||
| types: [opened, synchronize, labeled] | ||
| branches: ['*ci-test/**'] | ||
|
|
||
| env: | ||
| PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }} | ||
| OLD_DOT_COMMIT: ${{ github.event.inputs.OLD_DOT_COMMIT }} | ||
|
|
||
| jobs: | ||
| validateActor: | ||
|
|
@@ -63,6 +59,48 @@ jobs: | |
| echo "REF=$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| getOldDotPR: | ||
| runs-on: ubuntu-latest | ||
| needs: validateActor | ||
| if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }} | ||
| outputs: | ||
| OLD_DOT_PR: ${{ steps.old-dot-pr.outputs.result }} | ||
| steps: | ||
| - name: Check if author specifed Old Dot PR | ||
| id: old-dot-pr | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ github.token }} | ||
| result-encoding: string | ||
| script: | | ||
| const pullRequest = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: env.PULL_REQUEST_NUMBER, | ||
|
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. We need to use |
||
| }); | ||
|
|
||
| const body = pullRequest.data.body; | ||
| const regex = /MOBILE-EXPENSIFY:(?<prNumber>.*)/; | ||
| const found = body.match(regex)?.groups?.prNumber || ""; | ||
|
|
||
| return found.trim(); | ||
|
|
||
| getOldDotBranchRef: | ||
| runs-on: ubuntu-latest | ||
| needs: getOldDotPR | ||
| if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }} | ||
| outputs: | ||
| OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }} | ||
| steps: | ||
| - name: Check if pull request number is correct | ||
| id: getHeadRef | ||
| run: | | ||
| set -e | ||
| echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
|
|
||
| postGitHubCommentBuildStarted: | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -84,7 +122,7 @@ jobs: | |
|
|
||
| androidHybrid: | ||
| name: Build Android HybridApp | ||
| needs: [validateActor, getBranchRef] | ||
| needs: [validateActor, getBranchRef, getOldDotBranchRef] | ||
| if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }} | ||
| runs-on: ubuntu-latest-xl | ||
| outputs: | ||
|
|
@@ -100,15 +138,16 @@ jobs: | |
| fetch-depth: 0 | ||
|
|
||
| - name: Update submodule to match main | ||
| env: | ||
| OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} | ||
| run: | | ||
| git submodule update --init --remote | ||
| if [[ -z "$OLD_DOT_COMMIT" ]]; then | ||
| git fetch | ||
| git checkout ${{ env.OLD_DOT_COMMIT }} | ||
| fi | ||
|
|
||
| - name: Checkout Old Dot to author specified branch or commit | ||
| if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }} | ||
| run: | | ||
| cd Mobile-Expensify | ||
| git fetch | ||
| git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }} | ||
|
|
||
| - name: Configure MapBox SDK | ||
| run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} | ||
|
|
||
|
|
@@ -194,7 +233,7 @@ jobs: | |
|
|
||
| iosHybrid: | ||
| name: Build and deploy iOS for testing | ||
| needs: [validateActor, getBranchRef] | ||
| needs: [validateActor, getBranchRef, getOldDotBranchRef] | ||
| if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }} | ||
| env: | ||
| DEVELOPER_DIR: /Applications/Xcode_16.2.0.app/Contents/Developer | ||
|
|
@@ -210,14 +249,15 @@ jobs: | |
| fetch-depth: 0 | ||
|
|
||
| - name: Update submodule to match main | ||
| env: | ||
| OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }} | ||
| run: | | ||
| git submodule update --init --remote | ||
| if [[ -z "$OLD_DOT_COMMIT" ]]; then | ||
| git fetch | ||
| git checkout ${{ env.OLD_DOT_COMMIT }} | ||
| fi | ||
|
|
||
| - name: Checkout Old Dot to author specified branch or commit | ||
| if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }} | ||
| run: | | ||
| cd Mobile-Expensify | ||
| git fetch | ||
| git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }} | ||
|
|
||
| - name: Configure MapBox SDK | ||
| run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }} | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.