{"id":13994295,"url":"https://github.com/SiarheiFedartsou/fastlane-plugin-versioning","last_synced_at":"2025-07-22T19:31:51.111Z","repository":{"id":39897659,"uuid":"60367988","full_name":"SiarheiFedartsou/fastlane-plugin-versioning","owner":"SiarheiFedartsou","description":"Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks. ","archived":false,"fork":false,"pushed_at":"2024-08-03T00:55:18.000Z","size":321,"stargazers_count":505,"open_issues_count":9,"forks_count":60,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-03T02:18:41.734Z","etag":null,"topics":["automation","fastlane","ios","plist","versioning"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiarheiFedartsou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-03T18:07:48.000Z","updated_at":"2024-08-03T00:55:16.000Z","dependencies_parsed_at":"2024-01-18T04:51:53.710Z","dependency_job_id":"b3ebeef5-0397-491a-b1a8-f0c56e2d86e4","html_url":"https://github.com/SiarheiFedartsou/fastlane-plugin-versioning","commit_stats":{"total_commits":152,"total_committers":22,"mean_commits":6.909090909090909,"dds":0.5789473684210527,"last_synced_commit":"feaaff936cd825bd32a2ce8860151ed1591e3d9e"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiarheiFedartsou%2Ffastlane-plugin-versioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiarheiFedartsou%2Ffastlane-plugin-versioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiarheiFedartsou%2Ffastlane-plugin-versioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiarheiFedartsou%2Ffastlane-plugin-versioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiarheiFedartsou","download_url":"https://codeload.github.com/SiarheiFedartsou/fastlane-plugin-versioning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":214675192,"owners_count":15768122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","fastlane","ios","plist","versioning"],"created_at":"2024-08-09T14:02:48.522Z","updated_at":"2025-07-22T19:31:51.096Z","avatar_url":"https://github.com/SiarheiFedartsou.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Versioning `fastlane` Plugin\n\n![CI Status](https://travis-ci.org/SiarheiFedartsou/fastlane-plugin-versioning.svg?branch=master)\n[![License](https://img.shields.io/github/license/SiarheiFedartsou/fastlane-plugin-versioning.svg)](https://github.com/SiarheiFedartsou/fastlane-plugin-versioning/blob/master/LICENSE)\n[![Gem](https://img.shields.io/gem/v/fastlane-plugin-versioning.svg?style=flat)](http://rubygems.org/gems/fastlane-plugin-versioning)\n[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning)\n\n## Getting Started\n\nThis project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with fastlane-plugin-versioning, add it to your project by running:\n\n```bash\nfastlane add_plugin versioning\n```\n\n## About versioning\n\nExtends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.\nNote that all schemes that you pass to actions like `increment_version_number_in_plist`, `increment_build_number_in_xcodeproj` or `get_info_plist_path` in `scheme` parameter must be shared.\nTo make your scheme shared go to \"Manage schemes\" in Xcode and tick \"Shared\" checkbox near your scheme.\n\n\n### what is this `plist_build_setting_support` stuff about?!\nIf you have a xcodeproject and have updated to Xcode 11, you'll notice that if you change your build and version numbers through the UI, the actual numbers are now stored inside build settings inside build configuration. The Info.plist file -- where they used to be stored -- now contains build setting variables (looks like `$(CURRENT_PROJECT_VERSION)` or `$(MARKETING_VERSION)`, for build number and version number respectively).\nIf you are at this migration 'turning point', you have two options. you can either:\n\n- Continue using the legacy method of inserting build and versions directly into plists by simply add `plist_build_setting_support: true` to your plist action parameters\n\nOR \n\n- Change the command to be the xcodeproj variants - i.e. `increment_version_number_in_xcodeproj` or `increment_build_number_in_xcodeproj` these also apply to the `getters` of build and version numbers. \n\n##### Warning for those migrating\nVerify your plist files are using the build variables (new) `$(CURRENT_PROJECT_VERSION)` or `$(MARKETING_VERSION)`. You can force this migration by simply modifying Version/Build fields for each one of your targets in UI. If you forget to make this change, or something else is writing and replacing it, xcodeproj actions will successfully update, but your build will have no reference to those values essentially becoming NOOP\n\nWe will leave the plist actions in, as for those consumers who are limited to their upgrade path.\n\n## Actions\n\n### increment_version_number_in_plist\n\nIncrement/set the version number in a Info.plist of specific target. Doesn't use `agvtool` (unlike default `increment_version_number`).\n\n```ruby\nincrement_version_number_in_plist # Automatically increment patch version number.\nincrement_version_number_in_plist(\n  bump_type: 'patch' # Automatically increment patch version number\n)\nincrement_version_number_in_plist(\n  bump_type: 'minor' # Automatically increment minor version number\n)\nincrement_version_number_in_plist(\n  bump_type: 'minor',\n  omit_zero_patch_version: true # if true omits zero in patch version(so 42.10.0 will become 42.10 and 42.10.1 will remain 42.10.1), default is false\n)\nincrement_version_number_in_plist(\n  bump_type: 'major' # Automatically increment major version number\n)\nincrement_version_number_in_plist(\n  version_number: '2.1.1' # Set a specific version number\n)\nincrement_version_number_in_plist(\n  # Automatically increment patch version number. Use App Store version number as a source.\n  version_source: 'appstore'\n)\nincrement_version_number_in_plist(\n  # Automatically increment patch version number. Use App Store version number as a source.\n  version_source: 'appstore',\n  # optional two letter country code: \n  # specify if availability of your app is limited to a certain country\n  country: 'at'\n)\n\nincrement_version_number_in_plist(\n  # specify specific version number (optional, omitting it increments patch version number)\n  version_number: '2.1.1',   \n  # (optional, you must specify the path to your main Xcode project if it is not in the project root directory\n  # or if you have multiple xcodeproj's in the root directory)\n  xcodeproj: './path/to/MyApp.xcodeproj'  \n  # (optional)\n  target: 'TestTarget' # or `scheme`\n)\n\nincrement_version_number_in_plist(\n  # specify specific version number (optional, omitting it increments patch version number)\n  version_number: '2.1.1',   \n  # (optional, you must specify the path to your main Xcode project if it is not in the project root directory\n  # or if you have multiple xcodeproj's in the root directory)\n  xcodeproj: './path/to/MyApp.xcodeproj'  \n  # (optional)\n  target: 'TestTarget' # or `scheme`\n  plist_build_setting_support: true, # optional, and defaulting to false.\n  # setting this will resolve the version number using the relevant build settings from your xcodeproj.\n)\n\n```\n\n#### plist_build_setting_support\n`get_version_number_from_plist` supports the `plist_build_setting_support` flag, and will either use the other parameters you pass to resolve a particular build configuration to edit, _OR_ change __ALL__ of them.\n\n\n### get_version_number_from_plist\n\nGet the version number from an Info.plist of specific target. Doesn't use `agvtool` (unlike default `get_version_number`).\n\n```ruby\nversion = get_version_number_from_plist(xcodeproj: 'Project.xcodeproj', # optional\n                                        target: 'TestTarget', # optional, or `scheme`\n                                        # optional, must be specified if you have different Info.plist build settings\n                                        # for different build configurations\n                                        plist_build_setting_support: true, # optional, and defaulting to false. setting this will \n                                        # resolve the version number using the relevant build settings from your xcodeproj.\n                                        build_configuration_name: 'Release')\n```\n\n#### plist_build_setting_support\n`get_version_number_from_plist` supports the `plist_build_setting_support` flag, and will either use the other parameters you pass to resolve a particular build configuration to retrieve, _OR_ pick the first it finds.\n\n### get_app_store_version_number\n\n\n```ruby\nversion = get_app_store_version_number(xcodeproj: 'Project.xcodeproj', # optional\n                                       target: 'TestTarget', # optional, or `scheme`\n                                       # optional, must be specified if you have different Info.plist build settings\n                                       # for different build configurations\n                                       build_configuration_name: 'Release')\n\nversion = get_app_store_version_number(xcodeproj: 'Project.xcodeproj', # optional\n                                       target: 'TestTarget', # optional, or `scheme`\n                                       # optional, must be specified if you have different Info.plist build settings\n                                       # for different build configurations\n                                       build_configuration_name: 'Release',\n                                       # optional, must be specified for the lookup to succeed, \n                                       # if your app is only published to one country \n                                       # passed value must be a country code\n                                       country: 'at')\n\nversion = get_app_store_version_number(bundle_id: 'com.apple.Numbers')\n\nversion = get_app_store_version_number(bundle_id: 'com.apple.Numbers',\n                                       # optional two letter country code: \n                                       # specify if availability of your app is limited to a certain country\n                                       country: 'at')\n\n```\n\n### get_version_number_from_git_branch\n\n```ruby\n# Extracts version number from git branch name.\n# `pattern` is pattern by which version number will be found, `#` is place where action must find version number.\n# Default value is 'release-#'(for instance for branch name 'releases/release-1.5.0' will extract '1.5.0')\nversion = get_version_number_from_git_branch(pattern: 'release-#')\n```\n\n### increment_build_number_in_plist\n\nIncrement/set build number in Info.plist of specific target. Doesn't use `agvtool` (unlike default `increment_version_number`).\n\n```ruby\nincrement_build_number_in_plist # Automatically increments the last part of the build number.\nincrement_build_number_in_plist(\n  build_number: 42 # set build number to 42\n)\n```\n\n#### plist_build_setting_support\n`increment_build_number_in_plist` supports the `plist_build_setting_support` flag, and will either use the other parameters you pass to resolve a particular build configuration to edit, _OR_ change __ALL__ of them.\n\n### get_build_number_from_plist\n\nGet the build number from an Info.plist of specific target. Doesn't use `agvtool` (unlike default `get_build_number`).\n\n```ruby\nversion = get_build_number_from_plist(xcodeproj: \"Project.xcodeproj\", # optional\n                                      target: 'TestTarget', # optional, or `scheme`\n                                      plist_build_setting_support: true, # optional, and defaulting to false. setting this will \n                                      # resolve the build number using the relevant build settings from your xcodeproj.\n                                      build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations\n```\n\n#### plist_build_setting_support\n`get_build_number_from_plist` supports the `plist_build_setting_support` flag, and will either use the other parameters you pass to resolve a particular build configuration to retrieve, _OR_ pick the first it finds.\n\n### increment_build_number_in_xcodeproj\n\nIncrement/set build number in a xcodeproj of specific target. Doesn't use `agvtool` (unlike default `increment_build_number`).\n\n```ruby\nincrement_build_number_in_xcodeproj # Automatically increments the last part of the build number.\nincrement_build_number_in_xcodeproj(\n  build_number: 42 # set build number to 42\n)\n```\n\n### get_build_number_from_xcodeproj\n\nGet the build number from a xcodeproj - specific to a target. Doesn't use `agvtool` (unlike default `get_build_number`).\n\n```ruby\nversion = get_build_number_from_xcodeproj(xcodeproj: \"Project.xcodeproj\", # optional\n                                          target: 'TestTarget', # optional, or `scheme`\n                                          build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations\n```\n\n### increment_version_number_in_xcodeproj\n\nIncrement/set the version number in a xcodeproj of specific target. Doesn't use `agvtool` (unlike default `increment_version_number`).\n\n```ruby\nincrement_version_number_in_xcodeproj # Automatically increment patch version number.\nincrement_version_number_in_xcodeproj(\n  bump_type: 'patch' # Automatically increment patch version number\n)\nincrement_version_number_in_xcodeproj(\n  bump_type: 'minor' # Automatically increment minor version number\n)\nincrement_version_number_in_xcodeproj(\n  bump_type: 'minor',\n  omit_zero_patch_version: true # if true omits zero in patch version(so 42.10.0 will become 42.10 and 42.10.1 will remain 42.10.1), default is false\n)\nincrement_version_number_in_xcodeproj(\n  bump_type: 'major' # Automatically increment major version number\n)\nincrement_version_number_in_xcodeproj(\n  version_number: '2.1.1' # Set a specific version number\n)\nincrement_version_number_in_xcodeproj(\n  # Automatically increment patch version number. Use App Store version number as a source.\n  version_source: 'appstore'\n)\nincrement_version_number_in_xcodeproj(\n  # Automatically increment patch version number. Use App Store version number as a source.\n  version_source: 'appstore',\n  # optional two letter country code: \n  # specify if availability of your app is limited to a certain country\n  country: 'at'\n)\n\nincrement_version_number_in_xcodeproj(\n  # specify specific version number (optional, omitting it increments patch version number)\n  version_number: '2.1.1',   \n  # (optional, you must specify the path to your main Xcode project if it is not in the project root directory\n  # or if you have multiple xcodeproj's in the root directory)\n  xcodeproj: './path/to/MyApp.xcodeproj'  \n  # (optional)\n  target: 'TestTarget' # or `scheme`\n)\n\n```\n\n### get_version_number_from_xcodeproj\n\nGet the version number from a xcodeproj - specific to a target. Doesn't use `agvtool` (unlike default `get_build_number`).\n\n```ruby\nversion = get_version_number_from_xcodeproj(xcodeproj: 'Project.xcodeproj', # optional\n                                            target: 'TestTarget', # optional, or `scheme`\n                                            # optional, must be specified if you have different Info.plist build settings\n                                            # for different build configurations\n                                            build_configuration_name: 'Release')\n```\n\n### get_info_plist_path\n\nGet a path to target's Info.plist\n```ruby\nget_info_plist_path(xcodeproj: 'Test.xcodeproj', # optional\n                    target: 'TestTarget', # optional, or `scheme`\n                    # optional, must be specified if you have different Info.plist build settings\n                    # for different build configurations\n                    build_configuration_name: 'Release')\n```\n\n### ci_build_number\n\nGet CI system build number. Determined using environment variables defined by CI systems. Supports Jenkins, Travis CI, Circle CI, TeamCity, GoCD, Bamboo, Gitlab CI, Xcode Server, Bitbucket Pipelines, BuddyBuild, AppVeyor. Returns `1` if build number cannot be determined. \n\n```ruby\nincrement_build_number_in_plist(\n  build_number: ci_build_number\n)\n```\n\n\n\n## Issues and Feedback\n\n### SwiftPM\n\nSwiftPM can be tedious when using this plugin, at least in terms of git history and `xcodeproj`s. Up until recently, there were a number of annoyances caused by this plugin (and a downstream dependency of it) because writing to a project file would clobber some of the comment metadata inside of the project file and replace them - leaving you with the actual version change, but a number of other, less desirable changes too to hand pick through (or give up this plugin for). The advice is, update to `\u003e= 0.4.6` of this plugin, and follow [this advice](https://github.com/SiarheiFedartsou/fastlane-plugin-versioning/issues/59#issuecomment-878255057) - which is to make sure not to include the `.git` at the end of your SwiftPM dependency URLs.\n\n### New / Fresh projects\n\nNote that you will need to set the build and version numbers through Xcode's UI at least once to use this plugin without weird `nil:NilClass` issues. See this [issue](https://github.com/SiarheiFedartsou/fastlane-plugin-versioning/issues/60) for context\n\nFor any other issues and feedback about this plugin, please submit it to this repository.\n\n## Troubleshooting\n\nFor some more detailed help with plugins problems, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.\n\n## Using `fastlane` Plugins\n\nFor more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md) in the main `fastlane` repo.\n\n## About `fastlane`\n\n`fastlane` automates building, testing, and releasing your app for beta and app store distributions. To learn more about `fastlane`, check out [fastlane.tools](https://fastlane.tools).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiarheiFedartsou%2Ffastlane-plugin-versioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSiarheiFedartsou%2Ffastlane-plugin-versioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiarheiFedartsou%2Ffastlane-plugin-versioning/lists"}