flutter / website

Flutter documentation web site
https://docs.flutter.dev
Other
2.79k stars 3.2k forks source link

Clarify how to combine Fastlane Flutter and Travis CI #1749

Closed HerrNiklasRaab closed 3 months ago

HerrNiklasRaab commented 5 years ago

The point 3 of chapter "Cloud build and deploy setup" of this side: https://flutter.io/docs/deployment/fastlane-cd Should be explained much more detailed here: https://docs.fastlane.tools/getting-started/cross-platform/flutter/

I have totally no idea how to setup flutter fastlane and travis combined.

FYI: https://github.com/fastlane/docs/issues/739

janpio commented 5 years ago

What exactly doesn't work from the command mentioned under "Create the CI test script such as .travis.yml or .cirrus.yml in your repository root."?

Did you look at the example project that is mentioned in the footer of the page?

HerrNiklasRaab commented 5 years ago

I think, we should explain, the basic setup of a travis.yml and cirrus.yml. For cirrus.yml it is a little bit easier to understand because of the example, but I use travis in my projekt. And i need to search the whole web and pick some information from everywhere. I am now 2 Days in this search for information scenario. It is trial and error at the moment.

If extra explaining is to too much, at least i need a running example with Travis CI + Flutter + Fastlane + IOS + Android.

janpio commented 5 years ago

So you local setup is fully working (as the article advises before moving over to CI) and just the CI/Travis part is not working for you? What exactly does not work on Travis?

HerrNiklasRaab commented 5 years ago

Yes, correct! How do i set up Travis.yml for IOS and Android. This is my current approach:

matrix:
  include:
  - os: linux
    language: android
    licenses:
      - 'android-sdk-preview-license-.+'
      - 'android-sdk-license-.+'
      - 'google-gdk-license-.+'
    android:
      components:
        - tools
        - platform-tools
        - build-tools-28.0.3
        - android-27
        - extra-android-m2repository
        - extra-google-m2repository
        - extra-google-android-support
    install:
    - cd android
    - bundle install
    script:
    - echo "flutter.sdk=../../flutter/" >> local.properties
    - bundle exec fastlane beta
before_install:
- openssl aes-256-cbc -K $encrypted_94197833ced1_key -iv $encrypted_94197833ced1_iv
  -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
- gem install bundler
- git clone https://github.com/flutter/flutter.git -b beta --depth 1
- ./flutter/bin/flutter doctor
- ./flutter/bin/flutter packages get
- yes | sdkmanager "platforms;android-27"

It is totally trial and error to get this running. If i had examples it would be better.

HerrNiklasRaab commented 5 years ago

I don't know how to setup this in my travis.yml:

Create the CI test script such as .travis.yml or .cirrus.yml in your repository root. Shard your script to run on both Linux and macOS platforms. Remember to specify a dependency on Xcode for macOS (for example osx_image: xcode9.2). See fastlane CI documentation for CI specific setup. During the setup phase, depending on the platform, make sure that: Bundler is available using gem install bundler. For Android, make sure the Android SDK is available and the ANDROID_HOME path is set. Run bundle install in [project]/android or [project]/ios. Make sure the Flutter SDK is available and set in PATH. In the script phase of the CI task: Run flutter build apk --release or flutter build ios --release --no-codesign depending on the platform. cd android or cd ios. bundle exec fastlane [name of the lane].

janpio commented 5 years ago

What step exactly is not working right now?

HerrNiklasRaab commented 5 years ago

Currently this is the problem:

/home/travis/build/HerrNiklasRaab/hapii2/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:4: error: package io.flutter.plugins.firebase.cloudfirestore does not exist
import io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin;

This is my build log: https://api.travis-ci.com/v3/job/159330691/log.txt?log.token=Iz1-rLsGunsXvJ4rJan46w

My local build runs with fastlane, just tried again.

sfshaza2 commented 5 years ago

Not sure we intend to support this. @xster?

mmcc007 commented 5 years ago

Here is an example, running on travis, of how to automatically build, sign, release as beta for testing, release to both stores, and embed the version and build number in the release: https://github.com/mmcc007/fledge Here is the beta release https://travis-ci.org/mmcc007/todo/builds/493633473 and the release https://travis-ci.org/mmcc007/todo/builds/493657475 Should be a good starting point for automating builds with Fastlane.

xster commented 5 years ago

@digiter: we don't have any plans for additional docs but it could be reasonable to add more details.

atsansone commented 3 months ago

This issue has not been substantially updated since 2019. Closing this issue. If this issue is still a going concern, please file a new issue as the information already supplied might be out of date and no longer usable. Thanks!