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

Add ability to use Individual API key in deliver and pilot #22128

Conversation

manicmaniac
Copy link
Contributor

@manicmaniac manicmaniac commented Jul 5, 2024

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #22115

Description

altool used internally by deliver and pilot has not support Individual API Keys yet.

With this change, fastlane determines the type of API key when uploading a build, and if the API key is a Team API Key, it will use the API key as is, but if it is an Individual API Key, it will not use the key and will use the the application specific password.

Testing Steps

Prerequisites

Steps

# fastlane/Fastfile
lane :deploy do
  app_store_connect_api_key(
    key_id: ENV.fetch("INDIVIDUAL_API_KEY_ID"),
    key_content: ENV.fetch("INDIVIDUAL_API_KEY_CONTENT_BASE64"),
    is_key_content_base64: true,
  )
  pilot(ipa: "/path/to/app.ipa")
  deliver(ipa: "/path/to/app.ipa")
end
fastlane deploy

I successfully uploaded my app to TestFlight and AppStore Connect with this branch's fastlane.

@manicmaniac manicmaniac force-pushed the add-ability-to-use-individual-api-key-in-deliver-and-pilot branch 2 times, most recently from b04f6d1 to 7fb05db Compare July 25, 2024 04:55
@manicmaniac manicmaniac marked this pull request as ready for review July 25, 2024 12:36
@manicmaniac manicmaniac force-pushed the add-ability-to-use-individual-api-key-in-deliver-and-pilot branch from bc0e245 to 42b16e2 Compare August 5, 2024 08:30
@neorth
Copy link

neorth commented Sep 3, 2024

If I understand this correctly, when running the pilot command (with distribute_external set), this will:

  1. Use altool to upload the build - using app specific password
  2. Use the spaceship/testflight command to send for review and distribute to external testers - using individual API key

Did I get it somewhat correctly? :)

@manicmaniac
Copy link
Contributor Author

@neorth
Yes, your understanding is correct 👍

@neorth
Copy link

neorth commented Sep 24, 2024

Just tested this successfully using the pilot command. 🎉

Copy link
Contributor

@lucgrabowski lucgrabowski left a comment

Choose a reason for hiding this comment

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

Thank you for adding this enhancement. ❤️
Looks good to me 💯

@lucgrabowski lucgrabowski merged commit b61548c into fastlane:master Sep 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deliver cannot upload a build with Individual API Key
3 participants