Skip to content

Commit

Permalink
Merge branch 'main' into ci/add-web-job
Browse files Browse the repository at this point in the history
  • Loading branch information
staszekscp committed Dec 14, 2022
2 parents 38862b1 + 11cf564 commit 9168baa
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 28 deletions.
74 changes: 55 additions & 19 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build and deploy apps for testing

on:
workflow_dispatch:
inputs:
PULL_REQUEST_NUMBER:
description: Pull Request number for correct placement of apps
required: true
pull_request_target:
types: [opened, synchronize]
branches: ['*ci-test/**']
Expand All @@ -22,16 +26,38 @@ jobs:
username: ${{ github.actor }}
team: mobile-deployers

getBranchRef:
runs-on: ubuntu-latest
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
outputs:
REF: ${{steps.getHeadRef.outputs.REF}}
steps:
- name: Checkout
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Check if pull request number is correct
if: ${{ github.event_name == 'workflow_dispatch' }}
id: getHeadRef
run: |
set -e
gh pr checkout ${{ github.event.inputs.PULL_REQUEST_NUMBER }}
echo "REF=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

android:
name: Build and deploy Android for testing
needs: validateActor
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
runs-on: ubuntu-latest
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
steps:
# This action checks-out the repository, so the workflow can access it.
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.head_ref || needs.getBranchRef.outputs.REF }}

- uses: Expensify/App/.github/actions/composite/setupNode@main

Expand Down Expand Up @@ -64,7 +90,6 @@ jobs:
S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ad-hoc-expensify-cash
S3_REGION: us-east-1
PULL_REQUEST_NUMBER: ${{ github.event.number }}

- uses: actions/upload-artifact@v3
with:
Expand All @@ -73,14 +98,16 @@ jobs:

iOS:
name: Build and deploy iOS for testing
needs: validateActor
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
runs-on: macos-12
steps:
# This action checks-out the repository, so the workflow can access it.
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.head_ref || needs.getBranchRef.outputs.REF }}

- uses: Expensify/App/.github/actions/composite/setupNode@main

Expand Down Expand Up @@ -119,7 +146,6 @@ jobs:
S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ad-hoc-expensify-cash
S3_REGION: us-east-1
PULL_REQUEST_NUMBER: ${{ github.event.number }}

- uses: actions/upload-artifact@v3
with:
Expand All @@ -128,13 +154,16 @@ jobs:

desktop:
name: Build and deploy Desktop for testing
needs: validateActor
needs: [validateActor, getBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
runs-on: macos-12
steps:
# This action checks-out the repository, so the workflow can access it.
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: ${{ github.head_ref || needs.getBranchRef.outputs.REF }}
fetch-depth: 0

- uses: Expensify/App/.github/actions/composite/setupNode@main
Expand All @@ -159,17 +188,19 @@ jobs:
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

web:
name: Build and deploy Web
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.head_ref || needs.getBranchRef.outputs.REF }}
- uses: Expensify/App/.github/actions/composite/setupNode@main
- name: Configure AWS Credentials
uses: Expensify/App/.github/actions/composite/configureAwsCredentials@main
Expand All @@ -186,23 +217,21 @@ jobs:

- name: Deploy to S3 for internal testing
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://ad-hoc-expensify-cash/web/"$PULL_REQUEST_NUMBER"
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}

- name: Create CloudFront distribution for the PR if needed
run: ./.github/scripts/createCloudfrontDistribution.sh "$PULL_REQUEST_NUMBER"
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}

postGithubComment:
runs-on: ubuntu-latest
name: Post a GitHub comment with app download links for testing
needs: [android, ios, desktop, web]
needs: [getBranchRef, android, ios, desktop, web]
env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
steps:
- name: Checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ github.head_ref || needs.getBranchRef.outputs.REF }}

- uses: actions/download-artifact@v3

Expand All @@ -225,16 +254,23 @@ jobs:
run: |
cloudfront_url=$(aws cloudfront list-distributions --query "DistributionList.Items[?Origins.Items[?OriginPath=='/web/$PULL_REQUEST_NUMBER']].DomainName" --output text)
echo "cloudfront_url=$cloudfront_url" >> "$GITHUB_OUTPUT"
env:
PULL_REQUEST_NUMBER: ${{github.event.number}}
# This step removes previous comments with links connected to the PR
- name: maintain-comment
uses: actions-cool/maintain-one-comment@de04bd2a3750d86b324829a3ff34d47e48e16f4b
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
body-include: 'Use the links below to test this build in android and iOS. Happy testing!'
number: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
delete: true

- name: Publish links to apps for download
run: |
gh pr comment --body \
":test_tube::test_tube: Use the links below to test this build in android and iOS. Happy testing! :test_tube::test_tube:
| android :robot: | iOS :apple: | desktop :computer: | :spider_web: |
| ------------- | ------------- | ------------- | ------------- |
| ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} | https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg | https://${{steps.get_cloudfront_url.outputs.cloudfront_url}} |
| ![Android](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.android_paths).html_path}}) | ![iOS](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.ios_paths).html_path}}) | ![desktop](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/${{github.event.number}}/NewExpensify.dmg) | ![web](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://${{steps.get_cloudfront_url.outputs.cloudfront_url}}) |"
| ${{fromJson(steps.set_var.outputs.android_paths).html_path}} | ${{fromJson(steps.set_var.outputs.ios_paths).html_path}} | https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/$PULL_REQUEST_NUMBER/NewExpensify.dmg | https://${{steps.get_cloudfront_url.outputs.cloudfront_url}} |
| ![Android](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.android_paths).html_path}}) | ![iOS](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${{fromJson(steps.set_var.outputs.ios_paths).html_path}}) | ![desktop](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://ad-hoc-expensify-cash.us-east-1.amazonaws.com/desktop/$PULL_REQUEST_NUMBER/NewExpensify.dmg) | ![web](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://${{steps.get_cloudfront_url.outputs.cloudfront_url}}) |"
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001023806
versionName "1.2.38-6"
versionCode 1001023900
versionName "1.2.39-0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.38</string>
<string>1.2.39</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.2.38.6</string>
<string>1.2.39.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.38</string>
<string>1.2.39</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.38.6</string>
<string>1.2.39.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.2.38-6",
"version": "1.2.39-0",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down

0 comments on commit 9168baa

Please sign in to comment.