rubiconba / fastlane-plugin-flutter-version-manager Goto Github PK
View Code? Open in Web Editor NEWFastlane plugin that is used to manage app versioning of Flutter project
License: MIT License
Fastlane plugin that is used to manage app versioning of Flutter project
License: MIT License
This is more of a feature request if I am not wrong.
I may misuse this since I am new to fastlane and ruby, but I think it would be great to get the version back when using
version=flutter_version_manager(
arguments: "-version",
yml: "./version.yml",
pubspec: "./pubspec.yaml")
# use version
I've tried to run the plugin on local , it doesn't work gives me this error :
wecraft@Mac-mini-de-Wecraft android % bundle exec fastlane bump_minor
[โ] ๐
+-----------------------------------------+---------+-------------------------+
| Used plugins |
+-----------------------------------------+---------+-------------------------+
| Plugin | Version | Action |
+-----------------------------------------+---------+-------------------------+
| fastlane-plugin-flutter_version_manager | 1.0.0 | flutter_version_manager |
+-----------------------------------------+---------+-------------------------+
objc[3718]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7ad8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac02c8). One of the two will be used. Which one is undefined.
objc[3718]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7b28) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac0318). One of the two will be used. Which one is undefined.
[11:43:33]: ------------------------------
[11:43:33]: --- Step: default_platform ---
[11:43:33]: ------------------------------
[11:43:33]: Driving the lane 'bump_minor' ๐
[11:43:33]: -------------------------------------
[11:43:33]: --- Step: flutter_version_manager ---
[11:43:33]: -------------------------------------
+------------------+------------+
| Lane Context |
+------------------+------------+
| DEFAULT_PLATFORM | android |
| PLATFORM_NAME | |
| LANE_NAME | bump_minor |
+------------------+------------+
[11:43:33]: path does not exist
+------+-------------------------+-------------+
| fastlane summary |
+------+-------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------+-------------+
| 1 | default_platform | 0 |
| ๐ฅ | flutter_version_manager | 0 |
+------+-------------------------+-------------+
[11:43:33]: fastlane finished with errors
Looking for related GitHub issues on fastlane/fastlane...
โก๏ธ The resource 'resetRatingsRequests' does not exist
https://github.com/fastlane/fastlane/issues/20098 [open] 4 ๐ฌ
2 weeks ago
โก๏ธ Build number: xyz does not exist
https://github.com/fastlane/fastlane/issues/19983 [open] 1 ๐ฌ
3 weeks ago
โก๏ธ Build number: xx.yy does not exist
https://github.com/fastlane/fastlane/issues/19840 [open] 4 ๐ฌ
3 weeks ago
Which path is it referring to ? and whether I should keep trying to fix the issues am getting will this work for me ? This is a very useful plugin but there's no documentation @davormaricdev , can you please help me on how to fix the errors am getting locally and how tp run the lanes through GitLab CI please I've been stuck
The plugin works just fine remotely , I also managed to make it work on GitLab CI , the problem is that on my pipeline everything is going well , I can see the new version + I added a lane that sends me a message on slack with the new version etc But when I checked my main branch I did not find the modifications on the version .yml file neither pubspec
this is my fastfile :
default_platform(:android)
def versionString()
file=YAML.load_file("../../version.yml")
version="#{file['major']}.#{file['minor']}.#{file['patch']}"
UI.message version
return version
end
def send_app_version(exception)
ver = versionString
slack(
message: "App new version after last merge is ",
success: false,
slack_url: "https://your slack incoming webhook url",
attachment_properties: {
fields: [
{
title: "Build number",
value: ENV["BUILD_NUMBER"],
},
{
title: "Error message",
value: exception.to_s,
short: false
}
]
}
)
end
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assembleRelease")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "clean assembleRelease")
upload_to_play_store
end
end
lane :bump do
flutter_version_manager(
arguments: "-minor",
yml: "../version.yml",
pubspec: "../pubspec.yaml",
git_repo: ".."
)
end
platform :android do
desc "send app version to slack"
lane :slack_message do
ver = versionString
slack(
message: "App version after last merge is #{ver} ",
success: true,
slack_url: "https://hooks.slack.com/services/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"
)
end
end
GitLab CI file :
image: "cirrusci/flutter:2.8.1"
before_script:
- flutter pub get
- "export VERSION_SHA=`echo ${CI_COMMIT_SHORT_SHA}` && echo $VERSION_SHA"
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.3"
ANDROID_SDK_TOOLS: "4333796"
VERSION_SHA: $CI_COMMIT_SHORT_SHA
stages:
- test # All jobs related for testing such as Unit Test
- build
- versionning
flutter_test: # Name of the lane
stage: test # type of stage
script:
- flutter test # Run Flutter test
flutter_build_android: #Job name
stage: build # kind of job
variables:
VERSION_SHA: $CI_COMMIT_SHORT_SHA
before_script:
- flutter packages get
- flutter clean
script:
- flutter build apk
artifacts:
paths:
- build/app/outputs/apk/release/app-release.apk
flutter_increment_app_version:
dependencies: []
stage: versionning
before_script:
- cd android/
- gem update --system
- export BUNDLE_GEMFILE=$(pwd)/Gemfile
- bundle install
- fastlane install_plugins --verbose
script:
- bundle exec fastlane bump
- bundle exec fastlane slack_message
only:
- merge_requests
pipeline :
+-----------------------------------------+---------+-------------------------+
[410](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L410)| Used plugins |
[411](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L411)+-----------------------------------------+---------+-------------------------+
[412](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L412)| Plugin | Version | Action |
[413](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L413)+-----------------------------------------+---------+-------------------------+
[414](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L414)| fastlane-plugin-flutter_version_manager | 1.0.0 | flutter_version_manager |
[415](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L415)+-----------------------------------------+---------+-------------------------+
[416](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L416)[17:00:57]: ------------------------------
[417](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L417)[17:00:57]: --- Step: default_platform ---
[418](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L418)[17:00:57]: ------------------------------
[419](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L419)[17:00:57]: Driving the lane 'bump' ๐
[420](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L420)[17:00:57]: -------------------------------------
[421](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L421)[17:00:57]: --- Step: flutter_version_manager ---
[422](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L422)[17:00:57]: -------------------------------------
[423](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L423)[17:00:57]: Previous app version: 1.0.0+2
[424](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L424)[17:00:57]: New app version: 1.1.0+51246021
[425](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L425)+------+-------------------------+-------------+
[426](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L426)| fastlane summary |
[427](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L427)+------+-------------------------+-------------+
[428](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L428)| Step | Action | Time (in s) |
[429](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L429)+------+-------------------------+-------------+
[430](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L430)| 1 | default_platform | 0 |
[431](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L431)| 2 | flutter_version_manager | 0 |
[432](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L432)+------+-------------------------+-------------+
[433](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L433)[17:00:57]: fastlane.tools finished successfully ๐
[434](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L434)$ bundle exec fastlane slack_message
[435](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L435)Your Gemfile lists the gem fastlane-plugin-flutter_version_manager (>= 0) more than once.
[436](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L436)You should probably keep only one of them.
[437](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L437)Remove any duplicate entries and specify the gem only once.
[438](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L438)While it's not a problem now, it could cause errors if you change the version of one of them later.
[439](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L439)Your Gemfile lists the gem git (>= 0) more than once.
[440](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L440)You should probably keep only one of them.
[441](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L441)Remove any duplicate entries and specify the gem only once.
[442](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L442)While it's not a problem now, it could cause errors if you change the version of one of them later.
[443](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L443)[17:00:59]: Plugin 'FlutterVersionManager' overwrites already loaded action 'flutter_version_manager'
[444](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L444)+-----------------------------------------+---------+-------------------------+
[445](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L445)| Used plugins |
[446](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L446)+-----------------------------------------+---------+-------------------------+
[447](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L447)| Plugin | Version | Action |
[448](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L448)+-----------------------------------------+---------+-------------------------+
[449](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L449)| fastlane-plugin-flutter_version_manager | 1.0.0 | flutter_version_manager |
[450](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L450)+-----------------------------------------+---------+-------------------------+
[451](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L451)[17:00:59]: ------------------------------
[452](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L452)[17:00:59]: --- Step: default_platform ---
[453](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L453)[17:00:59]: ------------------------------
[454](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L454)[17:00:59]: Driving the lane 'android slack_message' ๐
[455](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L455)[17:00:59]: 1.1.0
[456](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L456)[17:00:59]: -------------------
[457](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L457)[17:00:59]: --- Step: slack ---
[458](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L458)[17:00:59]: -------------------
[459](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L459)[17:00:59]: Successfully sent Slack notification
[460](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L460)+------+------------------+-------------+
[461](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L461)| fastlane summary |
[462](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L462)+------+------------------+-------------+
[463](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L463)| Step | Action | Time (in s) |
[464](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L464)+------+------------------+-------------+
[465](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L465)| 1 | default_platform | 0 |
[466](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L466)| 2 | slack | 0 |
[467](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L467)+------+------------------+-------------+
[468](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L468)[17:00:59]: fastlane.tools finished successfully ๐
[470](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L470)
Cleaning up project directory and file based variables
00:01
[472](https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile/-/jobs/2332607341#L472)Job succeeded
I've got a function that reads the version from version.yml file returns it so I can use it to send slack messages with the app version like so :
def versionString()
file=YAML.load_file("../../version.yml")
version="#{file['major']}.#{file['minor']}.#{file['patch']}"
UI.message version
return version
end
and as you can see in the pipeline , it successfully read the version from the file and sent it in a slack message . How can this happen when the version.yml file has not been changed when I checked on my main repo? where are the changes gone ? and why are the version.yml and pubspec.yaml files unchanged on main branch when clearly the version changed? How can I fix this please I need to see the changes on my main branch after the pipeline is successfully run. Thank you in advance
Run fastlane add_plugin flutter_version_manager
using fastlane 2.183 and I get the following:
Error loading plugin 'fastlane-plugin-flutter_version_manager': cannot load such file -- git
| fastlane-plugin-flutter_version_manager | 1.0.0 | No actions found |
+---------------------------------------------+---------+--------------------------------------+
[!] No actions were found while loading one or more plugins
Please use `bundle exec fastlane` with plugins
More info - https://docs.fastlane.tools/plugins/using-plugins/#run-with-plugins
thank you so much for your help it worked , but the version was : 1.0.0+2 when I applied bump-patch it became like this : 0.0.2+51144791 , this is not what I want to happen I want to keep the build number (after the plus sign ) also keep the major /minor only bump patch !
I would like to bump code version.
Example from 1.0.0+1 to 1.0.0+2
How can I do that?
How to check git log based on version: 1.0.5+77326735 ?
Is this 77326735
a unix timestamp?
I tried this. But it seems this package has some offset set?
git log --date=unix --before=1635020939 --after=1635020939 --pretty=format:"%h"
I used
lane :bump_patch do
flutter_version_manager(
arguments: "-patch",
yml: "./version.yml",
pubspec: "./example_pubspec.yaml")
end
to only bump patch and not to have a huge number as version code. Instead, can we just increase the version code by 1?
I see that there is one issue with having the commit time as a build number, and is that you can't have the real build number committed in pubspec.yaml
.
As the build number is based on the previous commit time, at the moment someone commits, the commit time is not longer representing the right build number as is going to be always one commit behind.
For example if -apply
runs before commit, the current version stored in pubspec.yaml
will be the one in the previous commit, not the actual commit, and there is never a way to keep both in sync.
Hi,
in pubspec.yaml if we have same version for app and dev-dependencies (or dependencies probably), action apply_new_version
replace also version number in deps
version: 0.0.1+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
test_coverage: 0.5.0
dev_dependencies:
flutter_coverage_badge: 0.0.1+1
flutter_test:
sdk: flutter
is replaced by:
version: 0.0.1+7860469
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
test_coverage: 0.5.0
dev_dependencies:
flutter_coverage_badge: 0.0.1+7860469 // SHOULD STAY 1 <<-----------------
flutter_test:
sdk: flutter
Hi,
I have the following issue:
bundle exec fastlane ios_beta_app fails at the end
I tried different paths for the version.yml
the lane directory is:
/Users/myuser/AndroidStudioProjects/any_drive_student/ios/fastlane
while the version.yml and pubspec.yaml are in the root
[17:51:01]: No such file or directory @ rb_sysopen - ../../version.yml
+------+---------------------------+-------------+
| fastlane summary |
+------+---------------------------+-------------+
| Step | Action | Time (in s) |
+------+---------------------------+-------------+
| 1 | default_platform | 0 |
| 2 | pwd | 0 |
| 3 | build_app | 135 |
| 4 | firebase_app_distribution | 40 |
| ๐ฅ | flutter_version_manager | 0 |
+------+---------------------------+-------------+
[17:51:01]: fastlane finished with errors
[17:51:01]: Error accessing file, this might be due to fastlane's directory handling
[17:51:01]: Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details
bundler: failed to load command: fastlane (/Users/myuser/.gems/bin/fastlane)
Fastfile:
default_platform(:ios)
platform :ios do
desc "New iOS build for Counter Demo app"
lane :ios_beta_app do
sh "pwd"
build_app(
scheme: "Runner",
archive_path: "./build/Runner.xcarchive",
export_method: "development",
output_directory: "./build/Runner"
)
firebase_app_distribution(
app: "XXX",
testers: "",
release_notes: "Initial test version of the app",
firebase_cli_path: "/usr/local/bin/firebase",
ipa_path: "./build/Runner/AnyDrive-Student.ipa"
)
flutter_version_manager(
arguments: "-patch",
yml: "../../version.yml",
pubspec: "../../pubspec.yaml")
end
end
Please suggest what can be done?
Thanks a lot
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.