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

[eas-cli] Add AppStore app creation to submission command #65

Merged
merged 14 commits into from
Nov 25, 2020

Conversation

barthap
Copy link
Contributor

@barthap barthap commented Nov 13, 2020

Added App Store Connect app creation, currently still depending on traveling-fastlane

Command flow

This is how the command flow currently works:

  1. Login to EAS + Ensure Expo project exists
  2. Ensure app exists on Apple Developer + App Store Connect

    This step can be skipped if provided --app-apple-id flag directly. This lets users omit the whole client-side login to Apple

    • Resolve appName and bundleIdentifier from flags first, then from app.json, eventually prompt
    • Login to Apple (normal 2FA login),
    • Resolve App Store Connect Team ID
    • Create app on Apple Dev + App Store Connect (does nothing if already exists)
  3. [only if step 2 is skipped] Resolve Apple ID (from flag or prompt)
  4. Resolve archive source: build id/path/url
  5. Resolve appSpecificPassword (from env var or prompt)
  6. Send request to Submission Service. The request payload is:
{
   appleId,
   appAppleId,
   archiveUrl,
   appSpecificPassword
}

Example output

Click to expand
./bin/run submit --platform=ios --app-name="Hello World"
✔ Ensuring project @barthap10/hello-world is registered on Expo servers

Ensuring your app exists on App Store Connect. This step can be skipped by providing the --app-apple-id flag

Please enter your iOS bundle identifier.
You can also specify ios.bundleIdentifier in app.json file
✔ Bundle Identifier:  … barthap.HelloWorld
Please enter your Apple Developer Program account credentials. These credentials are needed to manage certificates, keys and provisioning profiles in your Apple Developer account.
The password is only used to authenticate with Apple and never stored on Expo servers
Learn more here https://docs.expo.io/distribution/security/#apple-developer-account-credentials
✔ Apple ID: … my-apple-id@icloud.com
Using password from your local Keychain. Learn more https://docs.expo.io/distribution/security#keychain
Authenticating to Apple Developer Portal...
Authenticated with Apple Developer Portal successfully!
You have 4 teams associated with your account
✔ Which team would you like to use? › … 3) XX11ABC22Z "My Awesome Team" (Individual)
Resolving your App Store Connect team...
Ensuring the app exists on App Store Connect, this may take a while...

+----------------+----------------------------+
|         Summary for produce 2.146.1         |
+----------------+----------------------------+
| app_identifier | barthap.HelloWorld         |
| app_name       | Hello World                |
| username       | my-apple-id@icloud.com     │ 
| language       | English                    |
| sku            | 165432107                  |
| platform       | ios                        |
| skip_itc       | false                      |
| skip_devcenter | false                      |
+----------------+----------------------------+

[09:55:09]: [DevCenter] App 'barthap.HelloWorld' already exists, nothing to do on the Dev Center
[09:55:13]: App 'barthap.HelloWorld' already exists (1234567894), nothing to do on App Store Connect
✔ What would you like to submit? › The latest build from Expo servers
✔ Your Apple app-specific password: xxxxxxx-xxxxxxx
┌─────────────────────────────────────────────────────────────────────────────────┐
│                             iOS Submission Summary                              │
├─────────────────────────┬───────────────────────────────────────────────────────┤
│ Archive URL             │ http://link.to/turtle-v2-artifact                     │
├─────────────────────────┼───────────────────────────────────────────────────────┤
│ Apple ID                │ my-apple-id@icloud.com                                │
├─────────────────────────┼───────────────────────────────────────────────────────┤
│ Apple app-specific      │ [hidden]                                              │
│ password                │                                                       │
├─────────────────────────┼───────────────────────────────────────────────────────┤
│  App Store Connect App  │ 1234567894                                            │
│ ID number               │                                                       │
├─────────────────────────┼───────────────────────────────────────────────────────┤
│ Project ID              │ e8d92d22-2946-4a96-8ee6-b6e6c00e74ff                  │
└─────────────────────────┴───────────────────────────────────────────────────────┘
✔ Scheduling Submission
✔ Submitting your app to Apple App Store

Also done

TODO (future PR)

  • Replace travelingFastlane with JS API after it supports iTunes teams/providers.
  • Find a name for --app-apple-id Renamed to --asc-app-id

Note: I'm repeating myself but this name is really confusing. The --asc-app-id param is corresponding to appAppleId variable, on ASC it's this one:
Screenshot 2020-11-13 at 07 37 56
It's in App Store Connect under General ->App Information

@barthap barthap force-pushed the @barthap/submissions/app-produce branch from 2a8c2ed to 4884010 Compare November 20, 2020 08:28
@barthap barthap changed the title @barthap/submissions/app produce [eas-cli] Add AppStore app creation to submission command Nov 20, 2020
@barthap barthap marked this pull request as ready for review November 20, 2020 09:14
@brentvatne
Copy link
Member

You can also specify ios.bundleIdentifier in app.json file

we should use the term app config instead:

You can also specify ios.bundleIdentifier in your app config file.

we can use terminal-link to link out to the docs.

@brentvatne
Copy link
Member

will follow up with a more thorough review next week :)

one other thing we may want to do here is move this command out of the build namespace. it's possible that developers will want to use eas submit without using eas build, especially as we add more features to it over time

Copy link
Contributor

@dsokal dsokal left a comment

Choose a reason for hiding this comment

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

Great job, take a look at my inline comments!

Comment on lines 88 to 110
'bundle-identifier': flags.string({
description: 'Your iOS Bundle Identifier (default: expo.ios.bundleIdentifier from app.json)',
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I'm not sure if this should be a command param. I'm not saying it's undesirable but rather we don't have a similar param for build commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, my current flow assumed:

  • Get bundle ID from this param
  • Then try to gather it from exp config
  • Finally, prompt user

But according to the comment below (about using getBundleIdentifier()), the flow can be changed to just gather it from param or config (remove prompt).

Providing bundle ID as param / asking for it is useful only in cases when user wants to submit an external binary and/or, if ever possible, to run eas submit from outside project directory (manifest not available).

packages/eas-cli/src/submissions/ios/AppProduce.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/submissions/ios/AppProduce.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/submissions/ios/IosSubmitCommand.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/submissions/ios/IosSubmitCommand.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/submissions/ios/utils/language.ts Outdated Show resolved Hide resolved
@dsokal
Copy link
Contributor

dsokal commented Nov 23, 2020

I'm in favor of --asc-app-id

@wkozyra95
Copy link
Contributor

wkozyra95 commented Nov 23, 2020

@brentvatne

You can also specify ios.bundleIdentifier in your app config file.

we can use terminal-link to link out to the docs.

Proper behavior of terminal link should be that if it's supported it should display text and if it's not display URL, but there are terminals that display text and it's not clickable. termianl-link has isSupported method that returns true in those cases, but links do not work. If we can't properly detect those cases we shouldn't use that lib at all.

@barthap
Copy link
Contributor Author

barthap commented Nov 23, 2020

Proper behavior of terminal link should be that if it's supported it should display text and if it's not display URL, but there are terminals that display text and is not clickable. termianl-link has isSupported method that returns true in those cases, but links do not work. If we can't properly detect those cases we shouldn't use that lib at all.

That's the exact reason why I didn't use terminal-link here

@barthap barthap force-pushed the @barthap/submissions/app-produce branch from c6ea47d to 2aca849 Compare November 23, 2020 12:12
@brentvatne
Copy link
Member

brentvatne commented Nov 25, 2020

which terminals are you concerned about? we use terminal-link extensively in expo-cli and intend to continue to use it in our cli tools so we should probably make this a broader discussion if there is some concern, rather than diverging on a per-command basis :) (this is not a blocker for this PR, just something we should discuss at some point to agree on a common strategy for these types of links)

@wkozyra95
Copy link
Contributor

@brentvatne
I didn't test different terminals extensively, but it does not work in the one I'm using terminator and I tested that on one more Linux terminal (I think it was gnome-terminal, but I'm not 100% sure) and it also didn't work there.

packages/eas-cli/src/commands/submit.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/commands/submit.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/commands/submit.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/commands/submit.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/commands/submit.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/build/ios/bundleIdentifer.ts Outdated Show resolved Hide resolved
@barthap barthap merged commit 2ae64e7 into main Nov 25, 2020
@barthap barthap deleted the @barthap/submissions/app-produce branch November 25, 2020 10:56
This was referenced Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants