New project
-
Create a new GitHub repository
Steps
-
open iOS project template and click
Use this template
->Create a new repository
-
fill new repository info
- change owner to
futuredapp
- preffered repo name is [product-name]-[platform], where [product-name] includes only name of the product, without client name (like Skoda))
- change repo visibility to
private
- click
Create repository
button
- change owner to
-
you will be redirected to the new repo in couple of seconds
-
in newly created repo:
- click
Settings
button -
edit default branch name -> rename it to
develop
-
disable
Wikis
(we do not use it) - disable
Issues
(we do not use it) - disable
Projects
(we do not use it) - enable
Allow auto-merge
- enable
Automatically delete head branches
(there is no need to delete branches manually after each PR merge) -
select
Rules
section -
set new branch ruleset
- fill
default branch protection
toRuleset Name
-
change
Enforcement status
toActive
-
click
Include default branch
to add default branch as target branch -
enable
Require a pull request before merging
- set
Required approvals
to 1 - enable
Dismiss stale pull request approvals when new commits are pushed
- set
-
keep
Require status checks to pass
unchecked for the moment (we'll set it up later)- don't forget to add the
test
action rule after opening your first PR (actions will appear in the list after their first run)
- don't forget to add the
-
click
Create
button, new ruleset appears in the list
- fill
- click
-
-
Configure Ruby environment and Fastlane
Steps
- clone your project's repo
-
create a new branch
feature/PROJ-1-Setup-project
where everything will be set up in next steps- PROJ is your project Jira identificator
- 1 is Jira task number (if you don't have Jira yet ask your PM)
-
if you haven't setup ruby on your machine yet
- follow manual steps of this tutorial
- install bundler from Terminal with
gem install bundler
-
in project folder
- edit
fastlane/Fastfile
to specify environment variables
- edit
-
in Terminal
- switch to repo root folder
- call
bundle install
to install gems -
create app in Apple Developer and App Store Connect portals
App Store Connect 2FA
If you need a 2FA code for
ops@futured.app
account when running the following Fastlane commands, please contact someone from the iOS team for assistance.App released from customer's ASC account
If you filled customer's environment variables in Fastfile
-
call
bundle exec fastlane create_apps
- if it's the first app for the account append
company_name:"My Company Inc"
parameter
- if it's the first app for the account append
-
call
bundle exec fastlane update_provisioning include_release:true create_branch:true
create_branch:true
parameter is needed only for the first time to create customer branch in our Apple certificates repo
App released from Futured's ASC account
- call
bundle exec fastlane create_apps
- call
bundle exec fastlane update_provisioning include_release:true
The app's release account is currently unknown
You can setup release account later
- call
bundle exec fastlane create_apps skip_release_app:true
- call
bundle exec fastlane update_provisioning
Once you're familiar with the release process, rerun the above command (no need to worry about duplication)
-
-
Create a new Xcode project
Steps
-
install
FuturedArchitecture
project template (if you haven’t done so yet)- paste the following script to Terminal and press enter
bash << 'EOF' #!/bin/bash echo "Cloning repository..." git clone --depth=1 git@github.com:futuredapp/FuturedKit.git echo "Running make..." (cd FuturedKit/Templates && make) echo "Cleaning up..." rm -rf FuturedKit echo "Done!" EOF
- paste the following script to Terminal and press enter
-
open Xcode (or close and open again for refresh templates) and select
File
->New
->Project
-
select
iOS
tab andSwiftUI App
fromFuturedArchitecture
and clickNext
button -
fill the project info and click
Next
button- write product name in CamelCased style
- organization identifier is
app.futured
- leave Include Tests checked (CI requires tests run)
-
choose your repo folder and click
Create
button- Xcode project will open
- close it and check the project's folder
- move content of
{ProjectName}
folder to the repo root (you need to rename it first to be able to move the content) - delete
{ProjectName}
folder - open Xcode project again
-
in Xcode:
-
change bundle identifier to kebab-cased style
app.futured.kebab-case-app-name
- select
root
- select main project target
- select
Signing & Capabilities
tab - change bundle id for all configurations
- select
-
setup Futured's architecture
-
add
FuturedKit
package dependency - https://github.com/futuredapp/FuturedKit.git -
add
FuturedArchitecture
to main project target -
optionally add
FuturedHelpers
to main project target if needed - see docs -
go to the
{project_name}App.swift
file and remove error at line 10#error("Add https://github.com/futuredapp/FuturedKit.git to the project!")
-
select
Issue navigator
, click theMacro target ...
warning and then clickTrust & Enable
button
-
-
add SwiftLint
- if you don't have installed SwiftLint locally call
brew install swiftlint
from Terminal - go to
Build Phases
tab - click
+
button - click
New Run Script Phase
- rename phase to
SwiftLint
and move it beforeCompile sources
phase - paste script bellow
if test -d "/opt/homebrew/bin/"; then PATH="/opt/homebrew/bin/:${PATH}" fi export PATH if which swiftlint >/dev/null; then swiftlint --fix # remove `swiftlint --fix` if you want to fix linting issues manually swiftlint else echo "error: SwiftLint not installed, run: brew install swiftlint" fi
- disable
User Script Sandboxing
inBuild Settings
- if you don't have installed SwiftLint locally call
-
configure the project for Continuous Deployment
-
build the project
-
-
-
Open pull request with the project setup
Steps
-
update
.github/CODEOWNERS
file- change
@futuredapp/ios
to@{github_username}
of teammate/teammates (or person who will perform code reviews)
- change
-
update project README and fill in all the strike-through points
- commit everything and open PR
-
after CI checks the PR,
test
check is now available to be added indefault branch protection
ruleset- add
test/test
check
- added check looks like this
- add
-
-
Enjoy!