Search Unity

Update fastlane

Discussion in 'Unity Build Automation' started by gdoai, Oct 20, 2020.

  1. gdoai

    gdoai

    Joined:
    Apr 14, 2020
    Posts:
    11
    The actual fastlane version in UCB is: 2.142.0

    The "update_fastlane" command doesn't work in UCB:

    2036: -----------------------------
    2037: --- Step: update_fastlane ---
    2038: -----------------------------
    2039: Looking for updates for fastlane...
    2040: Updating fastlane from 2.142.0 to 2.164.0...
    2041: (eval):117: warning: character class has ']' without escape
    2042: Finished updating fastlane
    2043: Cleaning up old versions...
    2044: fastlane.tools successfully updated! I will now restart myself...
    2045: sh: -c: line 0: syntax error near unexpected token `('


    My problem is that i'd like the "pilot" command to use the App Store Connect API Key to upload my build.

    But this is doable only with Fastlane v2.157.0+: https://github.com/fastlane/fastlane/releases/tag/2.157.0

    -> Did someone manage to update Fastlane in UCB?

    -> Or did someone manage to upload a build to App Store Connect using "pilot" command in Fastlane in a secure way? (e.g. with an Apple ID with 2 factor auth enabled)


    Thanks
     
  2. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    I upload to Apple with 2FA but not with Fastlane, just with Xcode tools. I believe I did it using an app specific password, so didn't need to do anything particularly difficult to get it to work

    post_build.sh
    Code (csharp):
    1.  
    2. #!/bin/bash
    3.  
    4. echo "Uploading IPA to Appstore Connect..."
    5.  
    6. path="$WORKSPACE/.build/last/$BUILD_TYPE/build.ipa"
    7. if xcrun altool --upload-app -f $path -u $ITUNES_USERNAME -p $ITUNES_PASSWORD ; then
    8.     echo "Upload IPA to Appstore Connect finished with success"
    9. else
    10.     echo "Upload IPA to Appstore Connect failed"
    11. fi
    12.  
    Just need to set BUILD_TYPE, ITUNES_USERNAME and ITUNES_PASSWORD in your environment variables for your configuration.

    the Build Type is what ever your config is called, so for example, my apple submission configuration is called production-ios, so that is what the BUILD_TYPE variable is.

    I push that file into git, and then it needs a reference in cloud ->Advanced Options-> Post-Build Scripts to {your path}/post_build.sh.

    Know its not fastlane, but works if you're just bothered about getting your build straight to itunes
     
  3. gdoai

    gdoai

    Joined:
    Apr 14, 2020
    Posts:
    11
    Thanks! I was hoping to do it with Fastlane, i will continue digging a bit but i'll use your method if i can't make it work.
     
  4. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    I tried with fastlane for a while, but couldn't get it working. It is supposed to be faster with Fastlane and obviously you can do a bit more with it like doing your store set up bits as well which would be nice.

    If you do find a way in fastlane, please do update in here, as I'd definitely be interesting and trying it out.
     
  5. gdoai

    gdoai

    Joined:
    Apr 14, 2020
    Posts:
    11
    So far, here are my findings:
    Keep you posted.
     
  6. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Did you manage to get any further with Fastlane?

    Are there any updates on getting the latest Fastlane installed for CloudBuild so that we can take advantage of the new functionality?
     
  7. gdoai

    gdoai

    Joined:
    Apr 14, 2020
    Posts:
    11
    No, now i'm using the post shell script method to upload the build on testflight and it works great with email + app specific password.
    Fastlane version is still 2.142.0 (tested today) and i didn't find a way to connect to appstore connect with app specific password.
    Maybe with xcode 12 support (mid december i think), UCB team will upgrade fastlane?
     
  8. c_andrews

    c_andrews

    Joined:
    Jan 26, 2015
    Posts:
    106
    Thanks yer im successfully using the same shell script, i'm not sure if there is another way to upload to Google Play.
     
  9. tarmo-jussila

    tarmo-jussila

    Joined:
    Jun 4, 2015
    Posts:
    42
    Is this still the case? Is the App Store Connect API usable with Unity Cloud Build yet?

    I was hoping to use the App Store Connect API since there would be no need for manually resetting the session keys once a month, which is a pain.