associazione-rousseau / camelot-flutter

Cross platform Flutter application to subscribe and vote on Rousseau.
GNU General Public License v3.0
15 stars 11 forks source link

Write Pipeline #25

Closed emanuelconunaemme closed 3 years ago

aledeniz commented 4 years ago

@emanuelconunaemme what do you have in mind for the build pipeline? Travis + Fastlane? Any alternative? If not, should we go ahead and setup an open source on Travis? I think it would make more sense for someone with an opensource@associazionerousseau.it mailbox (or something akin) to actually setup the open source project.

Those are the requirements:

image

aledeniz commented 4 years ago

I do have zero experience of building CI/CD pipelines for flutter, but I wouldn't mind to give it a try (my realm of professional experience is more building Windows web or server applications on Azure DevOps, TFS, CruiseControl.Net, .. with some occasional Jenkins, maven, ..). I have found an interesting introduction to the argument by Arne Molland.

emanuelconunaemme commented 4 years ago

So, I was checking for the native pipeline supported by github and found out the "Actions" there is also a marketplace where I picked "Flutter". This might work. Let's test it and if it works let's move from there. Here the resulting committed config file

Hopefully it's plug & play. Although, we probably need the introduction to the argument by Arne Molland

Assigning it on you and moving it to "doing", if you want you can assign it back to me.

aledeniz commented 4 years ago

@emanuelconunaemme do we need fast and slow pipelines? JIT vs AOT? Testing with JIT and linting with AOT? Or should we run on 4 nodes in parallel? Wouldn’t an error in a JIT build stop the other nodes?

Sent with GitHawk

aledeniz commented 4 years ago

@emanuelconunaemme a clarification about #60, it does build apk in macos, not for ios. When attempting to build for ios, I get this:

Building ios 8s
##[error]Process completed with exit code 1.
Run flutter build ios --debug
Building it.movimento5stelle.rousseau.rousseauVote for device (ios)...
════════════════════════════════════════════════════════════════════════════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning 
Profile for your project by:
  1- Open the Flutter project's Xcode target with
       open ios/Runner.xcworkspace
  2- Select the 'Runner' project in the navigator then the 'Runner' target
     in the project settings
  3- In the 'General' tab, make sure a 'Development Team' is selected. 
     You may need to:
         - Log in with your Apple ID in Xcode first
         - Ensure you have a valid unique Bundle ID
         - Register your device with your Apple Developer Account
         - Let Xcode automatically provision a profile for your app
  4- Build or run your project again
  5- Trust your newly created Development Certificate on your iOS device
     via Settings > General > Device Management > [your new certificate] > Trust

For the time being, in the next PR, I will add a comment in the yaml to clarify.

aledeniz commented 4 years ago

PR #62 proposes a two workflows pipeline: one for the release channel, on a release branch, the other for everything else (at the moment basically upstream/master would be used for the development/unstable channel).

aledeniz commented 4 years ago

@emanuelconunaemme about iOS, apparently since 2017 there is an open issue on flutter, and as for now, flutter doesn't really build an .ipa.

# creates an .app not an .ipa 
flutter build ios --release

In the answer by @cbracken from 2018 we can read:

Our currently supported iOS releasing process is described in Releasing for iOS and as noted, makes use of the Xcode UI.

Among the comments there are a couple of suggested work arounds. The first from @MisterJimson (note also @castrojr913's addition):

flutter build apk
cp build/app/outputs/apk/release/app-release.apk buildOutput/
flutter build ios
cd ios
xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive
xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipa
cd ..
cp ios/build/Runner.ipa/Runner.ipa buildOutput/`

The second from @therealjohnsummer: image The article suggested by @chrisdrobison on the same conversation has got a bit of the required code on MacOS:

$ mkdir /ProjectName
$ cd ProjectName
$ cp -r /Path/To/Your/IPA/File/LocalizationDemo.app .
$ cd ..
$ zip --symlinks -qr "LocalizationDemo.ipa" ProjectName
AfzalivE commented 4 years ago

@aledeniz

I find this this method gets an IPA that's slightly (2mb for me) bigger than if I archive using xcodebuild