Skip to content
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

Fix wrong Provisioning Profile and add directories to desktop upload #13129

Merged
merged 9 commits into from
Dec 1, 2022
58 changes: 25 additions & 33 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ jobs:
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Configure AWS Credentials
# Version: 1.5.5
uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Run Fastlane beta test
id: runFastlaneBetaTest
run: bundle exec fastlane android build_internal
Expand Down Expand Up @@ -99,6 +107,14 @@ jobs:
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Configure AWS Credentials
# Version: 1.5.5
uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Run Fastlane
run: bundle exec fastlane ios build_internal
env:
Expand Down Expand Up @@ -131,6 +147,14 @@ jobs:
env:
DEVELOPER_ID_SECRET_PASSPHRASE: ${{ secrets.DEVELOPER_ID_SECRET_PASSPHRASE }}

- name: Configure AWS Credentials
# Version: 1.5.5
uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Build desktop app for testing
run: npm run desktop-build-internal -- --publish always
env:
Expand All @@ -140,39 +164,7 @@ 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 }}

# web:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand we're still in a testing phase, but why did you remove the web build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turned out that it is not so simple to host multiple react apps in on S3 bucket. It seems that we may configure buckets to host a couple of apps with some predefined urls, but we have to dive deeper to find a way to do it dynamically (as we want to keep it in a folder with PR's number). Uploading the web app is not a problem, hosting it unfortunately might be.

# name: Build and deploy Web
# needs: validateActor
# if: ${{ fromJSON(needs.validateActor.outputs.IS_TEAM_MEMBER) }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
# with:
# fetch-depth: 0
# ref: ${{ github.event.pull_request.head.sha }}

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

# - name: Configure AWS Credentials
# # Version: 1.5.5
# uses: aws-actions/configure-aws-credentials@e97d7fbc8e0e5af69631c13daa0f4b5a8d88165b
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-east-1

# - name: Build web for staging
# run: npm run build-staging

# - name: Build docs
# run: npm run storybook-build
# continue-on-error: true

# - 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 }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

postGithubComment:
runs-on: ubuntu-latest
Expand Down
10 changes: 10 additions & 0 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
const {version} = require('../package.json');

const isPublishing = process.argv.includes('--publish');
const pullRequestNumber = process.env.PULL_REQUEST_NUMBER;

const s3Bucket = {
production: 'expensify-cash',
staging: 'staging-expensify-cash',
internal: 'ad-hoc-expensify-cash',
};

const s3Path = {
production: '/',
staging: '/',
internal: process.env.PULL_REQUEST_NUMBER
? `/desktop/${pullRequestNumber}/`
: '/',
};

const macIcon = {
production: './desktop/icon.png',
staging: './desktop/icon-stg.png',
Expand Down Expand Up @@ -50,6 +59,7 @@ module.exports = {
? s3Bucket[process.env.ELECTRON_ENV]
: 'ad-hoc-expensify-cash',
channel: 'latest',
path: isCorrectElectronEnv ? s3Path[process.env.ELECTRON_ENV] : '/',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just fail the Electron build early if process.env.ELECTRON_ENV is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you may be right, if there isn't any process.env.ELECTRON_ENV it means that the command is not correct. I've removed those checks from the electronBuilder.config.js file

},
],
afterSign: isPublishing ? './desktop/notarize.js' : undefined,
Expand Down
6 changes: 6 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@ platform :ios do

build_app(
workspace: "./ios/NewExpensify.xcworkspace",
skip_profile_detection: true,
scheme: "NewExpensify",
export_method: "ad-hoc",
export_options: {
method: "ad-hoc",
provisioningProfiles: {
"com.chat.expensify.chat" => "chat_expensify_adhoc",
}
manageAppVersionAndBuildNumber: false
}
)
Expand Down