Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions _articles/fastlane/TODO_app_name.md
Original file line number Diff line number Diff line change
@@ -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.)
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: TODO
---
https://github.com/fastlane/fastlane/tree/master/pem
Original file line number Diff line number Diff line change
@@ -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 `<widget>` 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:
```
<widget version='...' android-versionCode='...' ios-CFBundleVersion='...'>
```

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
42 changes: 42 additions & 0 deletions _articles/fastlane/increment-build-number.md
Original file line number Diff line number Diff line change
@@ -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
}
)
```

22 changes: 22 additions & 0 deletions _articles/fastlane/manage-testflight-testers-with-fastlane.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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