I am trying to setup a CI build for my Xamarin.iOS application using TeamCity and FAKE and upload the result (.ipa file) to HockeyApp. I am running in a small problem.
I managed to trigger the FAKE build script from TeamCity and also build my application successfully. The next step would be to call the "HockeyApp" method from the "HockeyAppHelper" module from FakeLib, but todo this I need the path to the .ipa file. All examples I find just hardcode the path (something like bin/iPhone/Release/*.ipa
) however in my case the .ipa will by dropped in a folder containing the a timestamp (like bin/iPhone/Release/MyApp 2017-01-24 17-16-56/MyApp.ipa
).
Question is how do I get hold of the .ipa file in the build script (because of the timestamp I cannot hardcode the path)?
Below is the section of the FAKE script responsible for building and uploading the .ipa:
Target "ios-adhoc" (fun () ->
RestorePackages "RidderCRM.iOS.sln"
UpdatePlist version versionNumber "RidderCRM.iOS"
iOSBuild (fun defaults ->
{defaults with
ProjectPath = "RidderCRM.iOS.sln"
Configuration = "Release"
Platform = "iPhone"
Target = "Build"
BuildIpa = true
Properties = [ "CodesignKey", "iPhone Distribution"; "CodesignProvision", "Automatic:AdHoc" ]
})
let appPath = Directory.EnumerateFiles(Path.Combine("RidderCRM.iOS", "bin", "iPhone", "Release"), "*.ipa").First()
TeamCityHelper.PublishArtifact appPath
HockeyApp (fun p ->
{p with
ApiToken = Environment.GetEnvironmentVariable("HockeyAppApiToken")
File = appPath
}) |> ignore
)