Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Fastlane integration and CI/CD Workflows #24

Draft
wants to merge 46 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0115714
chore(git): add fastlane, direnv, dotenv to gitignore
BradenM Aug 29, 2023
0139517
chore(tools): add tool-versions file
BradenM Aug 29, 2023
7e1c5ee
feat(bundle): add Gemfile with fastlane and cocoapods
BradenM Aug 29, 2023
9d7d305
feat(app): replace code sign parameters with variables
BradenM Aug 29, 2023
9582b08
fix(app): inject `import CrisisCleanup` via needle generate arg durin…
BradenM Aug 29, 2023
e6ec988
docs(readme): remove mention of manual addition of crisiscleanup inje…
BradenM Aug 29, 2023
b84aab2
fix(app): specify needle generated output file
BradenM Aug 29, 2023
bde7359
feat(fastlane): add config module for constants and action env defaults
BradenM Aug 29, 2023
3e5dd1a
feat(fastlane): add `Appfile`
BradenM Aug 29, 2023
e74fb2e
feat(fastlane): add `Matchfile` for certificates sync
BradenM Aug 29, 2023
e73ca27
feat(fastlane): implement `setup_keychain`, `authenticate`, `build`, …
BradenM Aug 29, 2023
a983b4f
docs(fastlane): update generated fastlane documentation
BradenM Aug 29, 2023
acb3e79
feat(dx): add shared envrc file
BradenM Aug 29, 2023
74924dc
feat(sops): add sops config
BradenM Aug 29, 2023
45be3a2
chore(git): ignore userdata, remove configs from ignore
BradenM Aug 29, 2023
5521981
chore(git): add sopsdiffer gitattributes
BradenM Aug 29, 2023
5857a49
chore(git): update app/config gitignore to only exclude non-encrypted…
BradenM Aug 29, 2023
b486457
feat(app/config): move AppConfig.xcconfig -> AppConfig.xcconfig.sample
BradenM Aug 29, 2023
c74a370
chore(tools): add age to tool versions
BradenM Aug 29, 2023
72c37d1
feat(app/config): remove old google service default info
BradenM Aug 29, 2023
2077e0b
feat(app/config): add encrypted debug configs
BradenM Aug 29, 2023
65cee17
feat(app/config): add encrypted release configs
BradenM Aug 29, 2023
8a6616a
feat(app): update config overwrite phase to decrypt target configuration
BradenM Aug 29, 2023
45a5196
feat(app): update google service config phase to decrypt target confi…
BradenM Aug 29, 2023
c888295
fix(app): specify input and outputs paths for google service info phase
BradenM Aug 29, 2023
06e953c
feat(fastlane): decrypt app configs during build lane
BradenM Aug 29, 2023
153b12c
fix(app/configs): remove renamed google service files
BradenM Aug 29, 2023
62a4a31
docs(fastlane): update generated fastlane docs
BradenM Aug 29, 2023
87944f0
feat(fastlane): add upload to testflight step for beta lane
BradenM Aug 29, 2023
7869041
fix(app/config): add encrypted google service configs back
BradenM Aug 29, 2023
7935b0b
chore(git): add build/build logs to gitignore
BradenM Sep 1, 2023
a5adf44
feat(envrc): add xcconfig override values to envrc
BradenM Sep 1, 2023
8a7b1cf
feat(fastlane): add application config values to fastlane config.
BradenM Sep 1, 2023
b2279d6
feat(fastlane): define app privacy rules
BradenM Sep 1, 2023
f41ddf3
feat(fastlane): add generated snapshot helper swift lib
BradenM Sep 1, 2023
a311087
feat(fastlane): update decrypt lane to find and act on all .enc files…
BradenM Sep 1, 2023
18c125d
feat(fastlane): add inject_config lane for injecting app config value…
BradenM Sep 1, 2023
b90d0ac
feat(fastlane): add privacy lane for syncing privacy rules
BradenM Sep 1, 2023
217983d
feat(fastlane): add check lane for performing pre-review checks
BradenM Sep 1, 2023
45f1300
feat(fastlane): implement `gather_build_args` private lane for build …
BradenM Sep 1, 2023
a03bec4
feat(fastlane): add generic build lane for compiling with different c…
BradenM Sep 1, 2023
e04a787
feat(fastlane): add test lane for executing ui/unit tests
BradenM Sep 1, 2023
9fe1c85
feat(fastlane): add release lane for building release build
BradenM Sep 1, 2023
e0e21a3
feat(fastlane): add demo snapfile config
BradenM Sep 1, 2023
caca8d9
docs(fastlane): update generated lane docs
BradenM Sep 1, 2023
5c9b5e0
feat(schemes): add UITests shared scheme
BradenM Sep 1, 2023
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
79 changes: 79 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash

# Team Shared direnv.
# See: https://github.com/direnv/direnv

# Enforces `set -euo pipefail` despite user local config.
strict_env

# forces "at least"
direnv_version 2.32.3

# User local additions.
source_env_if_exists .envrc.local

use rtx
layout ruby

##
# Find macos keychain path
###
find_keychain() {
if has security; then
security list-keychains | grep "$1" | tr -d '"' | tr -d ' '
fi
}

# Load rtx or asdf
if has rtx && has use_rtx; then
use rtx
elif has asdf && has use_asdf; then
log_status "rtx not found. Falling back to asdf."
use asdf
else
log_error "Neither rtx nor asdf are installed or integrated with direnv."
log_error "For asdf: https://asdf-vm.com/"
log_error "For rtx (asdf clone in rust): https://github.com/jdxcode/rtx"
fi

# Create `bundle exec` aliases
layout ruby

## Fastlane
export FASTLANE_USERNAME=${FASTLANE_USERNAME:-}
export FASTLANE_PASSWORD=${FASTLANE_PASSWORD:-}
export FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=${FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD:-}
export FASTLANE_TEAM_ID=${FASTLANE_TEAM_ID:-}

## Keychain
export KEYCHAIN_NAME=${KEYCHAIN_NAME:-ccu.keychain}
export KEYCHAIN_PASSWORD=${KEYCHAIN_PASSWORD:-}
export KEYCHAIN_PATH=${KEYCHAIN_PATH:-$(find_keychain "$KEYCHAIN_NAME")}

## Match
export MATCH_PASSWORD=${MATCH_PASSWORD:-}

## Produce
export PRODUCE_COMPANY_NAME=${PRODUCE_COMPANY_NAME:-"Crisis Cleanup, LLC"}

## App Store Connect
export APP_STORE_CONNECT_API_KEY_KEY_ID=${APP_STORE_CONNECT_API_KEY_KEY_ID:-}
export APP_STORE_CONNECT_API_KEY_ISSUER_ID=${APP_STORE_CONNECT_API_KEY_ISSUER_ID:-}
export APP_STORE_CONNECT_API_KEY_KEY=${APP_STORE_CONNECT_API_KEY_KEY:-}
export APP_STORE_CONNECT_API_KEY_DURATION=${APP_STORE_CONNECT_API_KEY_DURATION:-1200}
export APP_STORE_CONNECT_API_KEY_IN_HOUSE=${APP_STORE_CONNECT_API_KEY_IN_HOUSE:-false}

## App Config
export CCU_IS_PRODUCTION=${CCU_IS_PRODUCTION:-NO}
export CCU_IS_DEBUGGABLE=${CCU_IS_DEBUGGABLE:-YES}
export CCU_HOST_SCHEME=${CCU_HOST_SCHEME:-https}
export CCU_HOST=${CCU_HOST:-app.dev.crisiscleanup.io}
export CCU_API_HOST=${CCU_API_HOST:-api.dev.crisiscleanup.io}

export CCU_API_BASE_URL="${CCU_HOST_SCHEME}://${CCU_API_HOST}"
export CCU_BASE_URL="${CCU_HOST_SCHEME}://${CCU_HOST}"

export CCU_MAPS_API_KEY=${CCU_MAPS_API_KEY:-}
export CCU_DEBUG_EMAIL_ADDRESS=${CCU_DEBUG_EMAIL_ADDRESS:[email protected]}
export CCU_DEBUG_ACCOUNT_PASSWORD=${CCU_DEBUG_ACCOUNT_PASSWORD:-demodemo1}

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.xcconfig.enc diff=sopsdiffer
*.plist.enc diff=sopsdiffer
98 changes: 97 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,100 @@ Pods/
.build/

NeedleGenerated.swift
GoogleService-Info-*.plist

# Created by https://www.toptal.com/developers/gitignore/api/fastlane,dotenv,direnv,ruby
# Edit at https://www.toptal.com/developers/gitignore?templates=fastlane,dotenv,direnv,ruby

### direnv ###
.direnv
!.envrc
.envrc.*

### dotenv ###
.env

### fastlane ###
# fastlane - A streamlined workflow tool for Cocoa deployment
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

# fastlane specific
**/fastlane/report.xml

# deliver temporary files
**/fastlane/Preview.html

# snapshot generated screenshots
**/fastlane/screenshots

# scan temporary files
**/fastlane/test_output

# Fastlane.swift runner binary
**/fastlane/FastlaneRunner

### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

# Ignore Byebug command history file.
.byebug_history

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

# End of https://www.toptal.com/developers/gitignore/api/fastlane,dotenv,direnv,ruby

.Trash*
crisiscleanup.xcworkspace/xcuserdata/*
.build_logs
.build
7 changes: 7 additions & 0 deletions .sops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
creation_rules:
# bradenm
# deepp
# ad-ci
# ccu-ci
- age: >-
age1lahy804ukd2pq478t5kc06unc6vceedddjkcxfgg63mkt3gmpsnswavg9y, age16gtkkvx0hn8gpjtzua535mf293e9amufze8ertplzjq9wm5v7suq6kklef, age1kdk99szww9g85xd0yhcr6tcg7h7jftu6d6dnls8vfv5qtu9ykuws7acxle, age1gdtzvztuawfkvt3rfv8n7xalslxqtrcr5u4anrhuahcf7fc6eqmszkqtls
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
direnv 2.32.3
ruby 3.2.2
sops 3.7.3
cocoapods 1.12.1
age 1.1.1
Loading