Fastlane and Git working together
Fastlane is growing faster, it was bought by Fabric and again by Google (as a product of Fabric). In Fidesmo we’re totally fans of Fastlane and its huge ecosystem. Here is an example of the
lanes we use internally:
The most relevant point of this
lane is that it takes the version number and changelog from the existing Git information and you don’t have to worry about anything, just to define the kind of release you want to publish. To achieve that, the follow steps are executed:
- Ensures that you’re in master and the branch is clean
- Reads the last git TAG created and takes its number
- Set the version number according to the semantic parameter passed
- Increment the build number and manage the certificates and provisioning profiles
- Generates the app
- Publish a bump commit
- Publish a Github release
- And finally uploads the app to Fabric!
and the code:
Well, seems to be there are many steps, but using the Fastlane actions all of them are solved easily and you only have to configure them properly. Together with the Fastfile, inside the Fastlane folder we have added a configuration file named
.env with the content:
Remember to add the
fastlane/.env file to your
.gitignore. Is very important NOT to publish the
.env file with your keys onto your repository.
In order to run the
lane just type:
and we are done!