When using Fastlane you may find a need to fetch the latest Google Play version_code for you builds. Currently to do this we need create our own function which utilises google_play_track_version_codes. Below is the function which you can USE in your lanes to achieve this:
You can then use this file in your lanes in one simple command:
version_code = latest_googleplay_version_code
Hope this helps you with deploying your app using Fastlane!