mmcc007 / fledge Goto Github PK
View Code? Open in Web Editor NEWFledge: A CI/CD tool for Flutter
Home Page: https://mmcc007.github.io/fledge
License: MIT License
Fledge: A CI/CD tool for Flutter
Home Page: https://mmcc007.github.io/fledge
License: MIT License
Hey, me again :-)
I just had an issue where fledge stopped with the error:
must be in dev branch and all files committed and pushed
But of course i was in the dev branch and all files were commited and pushed. What went wrong: I still had another branch in my project, so the git branch
command lists:
androidx
* dev
master
As you can see, the dev branch exists and is active (hence the asterisk). But your code in lib/src/commands/beta.dart
has the validateRepo
function which contains
if (!(gitResult.isNotEmpty && gitResult[0].contains('dev')))
which explains why i got this error. You are expecting dev to the first line, while in my case it is the second. Unless there are other git version that do things differently, I'd suggest you iterate through the lines and see if the dev one starts with an asterisk.
Unless of course different git apps do not have the same output. My git version outputs:
Both are using this format.
PS. And no, you don't have to rush to fix this. I just deleted the androidx
branch and could continue. It was already merged so I didn't need it anymore.
fledge beta
Git error. Command: git log origin/dev..dev
fatal: ambiguous argument 'origin/dev..dev': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
Please suggest something to fix this...
Currently using https://github.com/mmcc007/todo for testing bug fixes and new features. But, since it is on a separate repo, it does not leave a git history.
Setting up an example app in the Fledge repo will show the git history of bug fixes and new features.
It works. Awesome!
I got a few quirks down the road though.
First is that my account has 2 step verification enabled. You do mention this in your manual. I created a second account, but when I tried to verify that i could login with it, it asked me to add security questions. I thought this might be another kind of 2 step verification, so I spent half an hour trying to disable it. Turns out it wasn't a problem at all, but maybe you could mention that part in your manual to save overly cautious people like me from this :-)
Taken from original post by @yvanvds in #2 (comment)
Attempting to set up a new project running on Windows. It appears there are some path checks that may be incorrect on Windows. I get the following stack:
Bad state: Not running from source in the Dart repo.
package:fledge/src/io.dart 552:5 dartRepoRoot.<fn>
package:fledge/src/io.dart 566:3 dartRepoRoot
package:fledge/src/io.dart 550:14 dartRepoRoot
package:fledge/src/io.dart 904:20 _pathTo7zip.<fn>
package:fledge/src/io.dart 905:3 _pathTo7zip
package:fledge/src/io.dart 902:14 _pathTo7zip
package:fledge/src/io.dart 924:40 _extractTarGzWindows.<fn>
===== asynchronous gap ===========================
package:fledge/src/io.dart 820:20 withTempDir
===== asynchronous gap ===========================
package:fledge/src/io.dart 915:10 _extractTarGzWindows
package:fledge/src/io.dart 842:18 extractTarGz
===== asynchronous gap ===========================
package:fledge/src/commands/config.dart 84:9 unpackTarGzFile
===== asynchronous gap ===========================
package:fledge/src/commands/config.dart 48:15 ConfigCommand.run
===== asynchronous gap ===========================
package:args/command_runner.dart 196:27 CommandRunner.runCommand
===== asynchronous gap ===========================
package:fledge/src/command_runner.dart 158:39 FledgeCommandRunner.runCommand.<fn>
dart:async new Future.sync
package:fledge/src/utils.dart 109:12 captureErrors.<fn>
dart:async runZoned
package:fledge/src/utils.dart 126:5 captureErrors
package:fledge/src/command_runner.dart 158:13 FledgeCommandRunner.runCommand
===== asynchronous gap ===========================
package:fledge/src/command_runner.dart 107:11 FledgeCommandRunner.run
===== asynchronous gap ===========================
..\..\flutter\.pub-cache\hosted\pub.dartlang.org\fledge-0.1.3\bin\main.dart 4:25 main
This is an unexpected error. Please run
fledge --trace config -b gitlab
and include the logs in an issue on https://github.com/mmcc007/fledge/issues/new
Hi, great lib.
I have few questions if you don’t mind.
As far as I understand, fledge’s just wrapping fastlane functionality. Which mean that fledge is dependent on ruby, bundle being installed.
So my first question is why not just directly use fastlane over fledge?
What are the advantages that fledge offers besides creating the platform specific fastlane folders?
Second the tool’s expecting a specific git branch name (dev), what if we have different setup for our branch naming?
Can anyone help me customize the default settings to create an Alpha release for both Android and iOS.
I have made changes in android/fastlane/Fastfile for the Alpha release. We need to create the Alpha environment for android and iOS both.
Following is my code in Fastfile in Alpha :
import "../../fastlane/Fastlane.common"
#fastlane_version "2.55.0"
opt_out_usage
before_all do
#ensure_git_branch
#ensure_git_status_clean
#git_pull
end
default_platform(:android)
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Build and push to play store track"
private_lane :build_and_push_to_play_store_track do |options|
get_build_name_and_build_number
release_notes(OS: 'android')
sh ("cd ../.. && flutter build apk --build-name=#{@build_name} --build-number=#{@build_number}")
upload_to_play_store(
track: options[:track],
apk: '../build/app/outputs/apk/release/app-release.apk',
json_key_data: ENV['GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE'],
#skip_upload_screenshots: false,
#skip_upload_images: false
)
end
desc 'Push a release build to beta track'
lane :beta do
#ensure_git_branch(branch: 'dev')
gradle(task: 'clean')
gradle(task: 'bundle', build_type: 'Release')
build_and_push_to_play_store_track(track: "beta")
end
desc 'Submit a new Alpha Build to Alpha'
lane :alpha do
gradle(task: 'clean')
gradle(task: 'bundle', build_type: 'Release')
build_and_push_to_play_store_track(track: 'alpha')
end
desc "Promote latest release build from beta to production and publish to the Play Store"
lane :release do
#ensure_git_branch(branch: 'master')
#build_and_push_to_play_store_track(track: "production")
release_notes(OS: 'android')
upload_to_play_store(
track: 'beta',
track_promote_to: 'production',
json_key_data: ENV['GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE'],
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true,
)
end
end
As I am a bit confused, can you please confirm for following :
For GOOGLE_DEVELOPER_SERVICE_ACCOUNT_ACTOR_FASTLANE
key in Gitlab CI-CD env variables. Do we need to pass the user email id which is used to log in the account or do we need to pass the value of private_key from the .json file downloaded from the process of the google developer console?
I got this error after running fledge config -b gitlab --trace on Windows
I already followed comments on Issue 16 and nothing.
C:\Users\jbaylac\Documents\projects\consumer_mobile>fledge config -b gitlab --trace
Bad state: Not running from source in the Dart repo.
package:fledge/src/io.dart 552:5 dartRepoRoot.<fn>
package:fledge/src/io.dart 566:3 dartRepoRoot
package:fledge/src/io.dart 550:14 dartRepoRoot
package:fledge/src/io.dart 904:20 _pathTo7zip.<fn>
package:fledge/src/io.dart 905:3 _pathTo7zip
package:fledge/src/io.dart 902:14 _pathTo7zip
package:fledge/src/io.dart 924:40 _extractTarGzWindows.<fn>
===== asynchronous gap ===========================
dart:async _AsyncAwaitCompleter.completeError
package:fledge/src/io.dart _extractTarGzWindows.<fn>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:fledge/src/io.dart _extractTarGzWindows.<fn>
package:fledge/src/io.dart 820:20 withTempDir
---- Log transcript ----
IO : Spawning "cmd /c ver" in C:\Users\jbaylac\Documents\projects\consumer_mobile\.
IO : Finished ver. Exit code 0.
| stdout:
| |
| | Microsoft Windows [Version 10.0.17134.706]
| Nothing output on stderr.
IO : unpacking package:fledge/resource/fastlane/fastlane.tar.gz to .
FINE: Extracting .tar.gz stream to ..
IO : Created temp directory C:\Users\jbaylac\AppData\Local\Temp\pub_671e8dba-7016-11e9-940b-04d3b0c275ad
IO : Creating C:\Users\jbaylac\AppData\Local\Temp\pub_671e8dba-7016-11e9-940b-04d3b0c275ad\data.tar.gz from stream.
FINE: Created C:\Users\jbaylac\AppData\Local\Temp\pub_671e8dba-7016-11e9-940b-04d3b0c275ad\data.tar.gz from stream.
IO : Deleting directory C:\Users\jbaylac\AppData\Local\Temp\pub_671e8dba-7016-11e9-940b-04d3b0c275ad.
ERR : Bad state: Not running from source in the Dart repo.
FINE: Exception type: StateError
ERR : package:fledge/src/io.dart 552:5 dartRepoRoot.<fn>
| package:fledge/src/io.dart 566:3 dartRepoRoot
| package:fledge/src/io.dart 550:14 dartRepoRoot
| package:fledge/src/io.dart 904:20 _pathTo7zip.<fn>
| package:fledge/src/io.dart 905:3 _pathTo7zip
| package:fledge/src/io.dart 902:14 _pathTo7zip
| package:fledge/src/io.dart 924:40 _extractTarGzWindows.<fn>
| ===== asynchronous gap ===========================
| dart:async _AsyncAwaitCompleter.completeError
| package:fledge/src/io.dart _extractTarGzWindows.<fn>
| ===== asynchronous gap ===========================
| dart:async _asyncThenWrapperHelper
| package:fledge/src/io.dart _extractTarGzWindows.<fn>
| package:fledge/src/io.dart 820:20 withTempDir
---- End log transcript ----
But then there's another problem: I cannot increase the version number. Reading the manual, i was under the assumption that it would increase automatically? Either way, increasing it manually does not work either:
fastlane start_beta major
[17:25:06]: fastlane detected a Gemfile in the current directory
[17:25:06]: however it seems like you don't use `bundle exec`
[17:25:06]: to launch fastlane faster, please use
[17:25:06]:
[17:25:06]: $ bundle exec fastlane start_beta major
[17:25:06]:
[17:25:06]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[17:25:11]: ---------------------------
[17:25:11]: --- Step: opt_out_usage ---
[17:25:11]: ---------------------------
[17:25:11]: Disabled upload of used actions
[17:25:11]: Could not find lane 'start_beta major'. Available lanes: start_beta, release
+------+---------------+-------------+
| fastlane summary |
+------+---------------+-------------+
| Step | Action | Time (in s) |
+------+---------------+-------------+
| 1 | opt_out_usage | 0 |
+------+---------------+-------------+
[17:25:11]: fastlane finished with errors
[!] Could not find lane 'start_beta major'. Available lanes: start_beta, release
I'm not sure how to handle that, because when I google for how to increase the build number with fastlane, the instructions don't come near to what is in your manual. So far i get by with removing the tags from git with:
git tag -d 0.0.1
git push -d origin 0.0.1
But that won't help me when i actually want to publish a new build.
Again, thanks for helping.
Originally posted by @yvanvds in #2 (comment)
Currently there is a local dependency on Fastlane (which currently only runs on a macOS). It is being used to issue some simple git commands. I will be removing this dependency in an upcoming release (as more and more steps get automated)
After the local fastlane dependency is removed, Fledge will run on developer's mac, linux or windows.
Hey, thanks for this. I followed your tutorial, using github and travis-ci. But my iOS build is stuck at sync_code_signing. I've disabled the suppress_output wrapper in Fastfile to get some more output, but can't really paste it all in here because there's a lot of sensitive text in there.
First step is loading the Matchfile, which is successful. Detected values are ok. Next the remote git repo is cloned and i get the message 'Successfully decrypted certificates repo. Sounds good.
Now there's an error:
[13:17:03]: Installing certificate...
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
[13:17:04]: There are no local code signing identities found.
My first thought that this was the problem, but I'm not sure. Because next it lists my Installed Certificate with all details and below that the Installed Provisioning Profile. Then I get a message:
All required keys, certificates and provisioning profiles are installed 🙌
[13:17:04]: Setting Provisioning Profile type to 'app-store'
[13:17:04]: Certificates and profiles installed
[13:17:04]: -----------------------------------------
[13:17:04]: --- Step: update_project_provisioning ---
[13:17:04]: -----------------------------------------
[13:17:04]: You’re updating provisioning profiles directly in your project, but have you considered easier ways to do code signing?
[13:17:04]: https://docs.fastlane.tools/codesigning/GettingStarted/
[13:17:04]: Downloading root certificate from (https://www.apple.com/appleca/AppleIncRootCertificate.cer) to path
'/tmp/AppleIncRootCertificate.cer'
[13:17:04]: Error setting value '' for option 'profile'
+------------------------------------+---------------------------------------------------------+
| Lane Context |
+------------------------------------+---------------------------------------------------------+
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/travis/Library/Keychains/login.keychain-db" |
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios beta |
| SIGH_PROFILE_TYPE | app-store |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"com.mute.klankenbos"=>"match AppStore com.mute.klankenbos"} |
+------------------------------------+---------------------------------------------------------+
[13:17:04]: Path to provisioning profile is invalid
So there's two errors here, right before and right after the Lane Context listing. And that's when the build stops, so I guess they're the real problem here. But since loading the certificates and profiles worked, I'm not sure where I should look now.
Any ideas? The fastlane match configuration succeeded without any problems earlier. I do realise that this is probably not an issue with your project, but I did follow all instructions in your manual. So it might be that something was left out. (Or maybe I simply forgot one of the steps, of course.)
Next I also needed to provide my Team ID in the ios Appfile. Perhaps this is only required because i have multiple teams? But again, it could be added to the manual.
Originally posted by @yvanvds in #2 (comment)
I know how to use flutter but the signing and release process is complex.
Thanks for making fledge btw.
Can you make a doc.md to show all the steps.
Getting apple and Android stuff setup. Have to go to their web site and press all these buttons. Swords names etc.
Getting fastlane setup locally.
Travis can only do android builds. Can it do iOS.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.