version_bump_podspec

Increment or set the version in a podspec file

You can use this action to manipulate any 'version' variable contained in a ruby file.
For example, you can use it to bump the version of a CocoaPods' podspec file.
It also supports versions that are not semantic: 1.4.14.4.1.
For such versions, there is an option to change the appendix (e.g. 4.1).

version_bump_podspec
Supported platforms ios, mac
Author @Liquidsoul, @KrauseFx

2 Examples

version = version_bump_podspec(path: "TSMessages.podspec", bump_type: "patch")
version = version_bump_podspec(path: "TSMessages.podspec", version_number: "1.4")

Parameters

Key Description Default
path You must specify the path to the podspec file to update *
bump_type The type of this version bump. Available: patch, minor, major patch
version_number Change to a specific version. This will replace the bump type value
version_appendix Change version appendix to a specific value. For example 1.4.14.4.1 -> 1.4.14.5
require_variable_prefix true by default, this is used for non CocoaPods version bumps only true

* = default value is dependent on the user's system


Lane Variables

Actions can communicate with each other using a shared hash lane_context, that can be accessed in other actions, plugins or your lanes: lane_context[SharedValues:XYZ]. The version_bump_podspec action generates the following Lane Variables:

SharedValue Description
SharedValues::PODSPEC_VERSION_NUMBER The new podspec version number

To get more information check the Lanes documentation.


Documentation

To show the documentation in your terminal, run

fastlane action version_bump_podspec

CLI

It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal

fastlane run version_bump_podspec

To pass parameters, make use of the : symbol, for example

fastlane run version_bump_podspec parameter1:"value1" parameter2:"value2"

It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"). Hashes are not currently supported.

It is recommended to add all fastlane actions you use to your Fastfile.


Source code

This action, just like the rest of fastlane, is fully open source, view the source code on GitHub


Back to actions