From db29389815198f928eeef131ee2f323890abd57d Mon Sep 17 00:00:00 2001 From: Jan Piotrowski Date: Thu, 7 Dec 2017 18:59:57 +0100 Subject: [PATCH] random article stubs --- _articles/fastlane/TODO_app_name.md | 14 ++++ ...ndling-of-version-numbers-with-fastlane.md | 44 +++++++++++ ...ate-changelogs-from-git-commit-messages.md | 74 +++++++++++++++++++ ...dle-ios-push-certificates-with-fastlane.md | 4 + ...ion-numbers-automatically-with-fastlane.md | 40 ++++++++++ _articles/fastlane/increment-build-number.md | 42 +++++++++++ ...manage-testflight-testers-with-fastlane.md | 22 ++++++ ...r-native-cordova-projects-with-fastlane.md | 24 ++++++ 8 files changed, 264 insertions(+) create mode 100644 _articles/fastlane/TODO_app_name.md create mode 100644 _articles/fastlane/advanced-handling-of-version-numbers-with-fastlane.md create mode 100644 _articles/fastlane/automatically-create-changelogs-from-git-commit-messages.md create mode 100644 _articles/fastlane/handle-ios-push-certificates-with-fastlane.md create mode 100644 _articles/fastlane/handle-version-numbers-automatically-with-fastlane.md create mode 100644 _articles/fastlane/increment-build-number.md create mode 100644 _articles/fastlane/manage-testflight-testers-with-fastlane.md create mode 100644 _articles/fastlane/mess-with-your-native-cordova-projects-with-fastlane.md diff --git a/_articles/fastlane/TODO_app_name.md b/_articles/fastlane/TODO_app_name.md new file mode 100644 index 0000000..2a03c81 --- /dev/null +++ b/_articles/fastlane/TODO_app_name.md @@ -0,0 +1,14 @@ +--- +title: TODO +--- + +# TODO +As soon as this is implemented, add this to the "Create your remote app" file before the "iOS" headline so the prompt goes away: + + +Now prepare your `Appfile` for remote creation of your app. Add this as the first line: + +``` +app_name "Fastlane Ionic" +``` +(Replace `Fastlane Ionic` with your `name` value from `config.xml` of course.) \ No newline at end of file diff --git a/_articles/fastlane/advanced-handling-of-version-numbers-with-fastlane.md b/_articles/fastlane/advanced-handling-of-version-numbers-with-fastlane.md new file mode 100644 index 0000000..79bb293 --- /dev/null +++ b/_articles/fastlane/advanced-handling-of-version-numbers-with-fastlane.md @@ -0,0 +1,44 @@ +--- +title: +published: true +date: 2017-08-29 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# Fastlane: Bump version numbers + +For now we handled version numbers manually in config.xml and let Fastlane only take care of the build numbers (See: ... for the difference between version and build numbers). But of course you can also create lanes that enable you do automate the changing of versions with Fastlane: + +lanes for: +major +minor +patch + +both for iOS and Android + +bump_major +bump_minor +bump_patch + +Read value from config.xml, modify value, write value back, commit changed config.xml to Git. + +Can be integrated into you release lanes or just be used individually. + + + +iOS example (for build number, not version!) +``` + desc "Bump build number, commit & push to remote" + lane :incrementBuild do + + # Bump build number + increment_build_number + + # Commit and push to remote + commit_version_bump( + message: 'Build number bump by fastlane - buildnumber lane', + force: true + ) + push_to_git_remote + end +``` \ No newline at end of file diff --git a/_articles/fastlane/automatically-create-changelogs-from-git-commit-messages.md b/_articles/fastlane/automatically-create-changelogs-from-git-commit-messages.md new file mode 100644 index 0000000..134c31d --- /dev/null +++ b/_articles/fastlane/automatically-create-changelogs-from-git-commit-messages.md @@ -0,0 +1,74 @@ +--- +title: +published: true +date: 2017-08-29 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# Fastlane: Create CHANGELOG from commit messages + +Good practice to offer testers some information on what actually changes. Depending on who is testing, you of course want to write this manually. But if you are just creating automatic builds of the developers changes for e.g. CI or testing by those same developers, you can get away by just taking the Git commit messages (of course presuming these are useful) to build a changelog that is attached to the build on Testflight, HockeyApp or similar + + +## Android in general + +https://github.com/fastlane/fastlane/tree/master/supply#changelogs-whats-new + + +## Use git commit messages + +https://docs.fastlane.tools/getting-started/ios/beta-deployment/#release-notes + + +## Alternative: From CHANGELOG.md + +``` +desc "Deploy a new build via HockeyApp" + lane :hockey do + + # Bump build number + increment_build_number + + # Download and install the latest AdHoc profile + sigh(adhoc: true, force: true, output_path: "./fastlane/provisioning") + + # Set version number to the one at the top of the CHANGELOG + readme = File.read("../CHANGELOG.md") + latest_version = readme.split("\n## ").first + first_line = latest_version.split("\n").first + version_number = first_line.split(" ")[1] + + increment_version_number(version_number: version_number) + + # Generate release notes from CHANGELOG + release_notes = latest_version.split("\n")[1..-1].join("\n") + puts release_notes + + # Create the IPA file - save in Temp folder + profileUDID = lane_context[SharedValues::SIGH_UDID] + puts "Profile UUID: #{profileUDID}" + gym( + xcargs: "PROVISIONING_PROFILE=#{profileUDID}", + scheme: "xxxxxxx", + silent: true + ) + + # Deploy via HockeyApp + markdown_type = '1' + hockey( + api_token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', + notes_type: markdown_type, + notes: release_notes + ) + + # Make sure our directory is clean, except for changes Fastlane has made + clean_build_artifacts + + # Commit and push to remote + commit_version_bump( + message: 'Build number bump by fastlane - hockey lane', + force: true + ) + push_to_git_remote + end +``` \ No newline at end of file diff --git a/_articles/fastlane/handle-ios-push-certificates-with-fastlane.md b/_articles/fastlane/handle-ios-push-certificates-with-fastlane.md new file mode 100644 index 0000000..549ab4a --- /dev/null +++ b/_articles/fastlane/handle-ios-push-certificates-with-fastlane.md @@ -0,0 +1,4 @@ +--- +title: TODO +--- +https://github.com/fastlane/fastlane/tree/master/pem \ No newline at end of file diff --git a/_articles/fastlane/handle-version-numbers-automatically-with-fastlane.md b/_articles/fastlane/handle-version-numbers-automatically-with-fastlane.md new file mode 100644 index 0000000..6301d10 --- /dev/null +++ b/_articles/fastlane/handle-version-numbers-automatically-with-fastlane.md @@ -0,0 +1,40 @@ +--- +title: +published: true +date: 2017-08-29 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# Handle build numbers automatically with Fastlane + + + +First: What are we talking about? +Version and Build: +* Version is the thing users see. It can be of many forms, most often it is `MAJOR.MINOR.PATCH`, e.g. `1.4.2` +* Build is internal for the stores to differentiate different builds. For Android this is most often just an incrementing integer, for iOS it can be whatever it wants (and is also only unique per Version, so it can repeat with each version) + +Cordova problem: +"Version" comes from `config.xml` as "version" of `` and is put into `CFBundleShortVersionString` for iOS (In Xcode: Project -> General -> Identity -> Version) and `versionName` for Android (AndroidManifest.xml: versionCode). +But "Build" is automatically and -magically generated when the project is built (`ionic start`, `cordova create`, `cordova prepare`). This makes controlling it from the outside a bit of work. + +Lucky for us, Cordova people also recognized this and we can set it for each platform in `config.xml` explicitly: +* `android-versionCode` overwrites the value for Android's `versionCode` +* `ios-CFBundleVersion` overwrites the value for iOS's `CFBundleVersion` + +So to set the Version and Build for both platforms, we can use: +``` + +``` + +This is the way we can manipulate our `config.xml` from fastlane to affect both Version and Build on both platforms. + + +> TODO: Integrate: Version numbers have to be written to Cordova project, otherwise will be lost + + +## iOS + + + +## Android \ No newline at end of file diff --git a/_articles/fastlane/increment-build-number.md b/_articles/fastlane/increment-build-number.md new file mode 100644 index 0000000..3e7b381 --- /dev/null +++ b/_articles/fastlane/increment-build-number.md @@ -0,0 +1,42 @@ +--- +title: 'Fastlane: Automatically increment build number of your Cordova project' +published: true +date: 2017-09-28 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# Automatically increment build number of your Cordova project with Fastlane + +## iOS + +Automatically increment the build number in the iOS project. + +Here with latest build number +1 from Testflight: + +```ruby + increment_build_number({ + build_number: latest_testflight_build_number + 1, # TODO magically available? + xcodeproj: xcodeprojpath + }) + # TODO Save new value to config.xml +``` + +## Android + +Automatically increment the build number in the iOS project. + +If you are uploading to Google Play alpha track: + +```ruby + play_version_codes = google_play_track_version_codes(track: 'alpha') + version_code = play_version_codes.first + 1 + gradle( + task: 'assemble', + build_type: 'Release', + project_dir: 'platforms/android', + properties: { + 'cdvVersionCode' => version_code # TODO check if this is the correct way to do this + } + ) + ``` + diff --git a/_articles/fastlane/manage-testflight-testers-with-fastlane.md b/_articles/fastlane/manage-testflight-testers-with-fastlane.md new file mode 100644 index 0000000..b85340a --- /dev/null +++ b/_articles/fastlane/manage-testflight-testers-with-fastlane.md @@ -0,0 +1,22 @@ +--- +title: +published: true +date: 2017-08-29 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# pilot to manage everything testflight + +https://github.com/fastlane/fastlane/tree/master/pilot + +Invite testers from the command line +No need to use the web interface + +https://github.com/fastlane/boarding + +Self serve invitation for testers as a simple website +Example: https://boarding.herokuapp.com/ +Heroku is free to use for the standard machine. + +Doesn't have to be public: +https://github.com/fastlane/boarding#security \ No newline at end of file diff --git a/_articles/fastlane/mess-with-your-native-cordova-projects-with-fastlane.md b/_articles/fastlane/mess-with-your-native-cordova-projects-with-fastlane.md new file mode 100644 index 0000000..66e789e --- /dev/null +++ b/_articles/fastlane/mess-with-your-native-cordova-projects-with-fastlane.md @@ -0,0 +1,24 @@ +--- +title: +published: true +date: 2017-08-29 16:00:00 +0000 +last_updated: '' +parent: ['Ionic + Fastlane', '../fastlane'] +--- +# ... + +As you saw before Fastlane is a great way to mess with your generated Cordova projects in a reproducible way: + +* We can do stuff to the XCode project TODO +* We can modify the Android project ... TODO +* You can edit the version in config.xml TODO + +You can use this feature set to also do other stuff, that Cordova projects might need but Cordova itself doesn't support out of the box: + +## Enabling / Disabling Application Services + +https://github.com/fastlane/fastlane/tree/master/produce#enabling--disabling-application-services + +## Creating Apple Pay merchants and associating them with an App ID + +https://github.com/fastlane/fastlane/tree/master/produce#creating-apple-pay-merchants-and-associating-them-with-an-app-id \ No newline at end of file