Skip to content

Commit

Permalink
Merge pull request #475 from nimblehq/release/4.4.0
Browse files Browse the repository at this point in the history
Release - 4.4.0
  • Loading branch information
vnntsu authored May 8, 2023
2 parents 70096c0 + 2b433c4 commit 384dd51
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- Close #https://github.com/nimblehq/ios-templates/issues/
- Close #

## What happened 👀

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/automatic_pull_request_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
name: Pull request review by Danger
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/cache@v2
- uses: actions/cache@v3
id: bunlderCache
with:
path: vendor/bundle
Expand All @@ -29,7 +29,7 @@ jobs:
run: bundle install --path vendor/bundle

- name: Cache Pods
uses: actions/cache@v2
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_app_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -34,21 +34,21 @@ jobs:
runs-on: macOS-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0

- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.4
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Bundle install
run: bundle install

- name: Cache Pods
uses: actions/cache@v2
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy_production_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -33,21 +33,21 @@ jobs:
name: Build
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0

- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.4
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Bundle install
run: bundle install

- name: Cache Pods
uses: actions/cache@v2
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_staging_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -33,13 +33,13 @@ jobs:
name: Build
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Set fetch-depth (default: 1) to get whole tree
with:
fetch-depth: 0

- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.4
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_install_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Test
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/test_upload_build_to_firebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test Upload Build to Firebase

# SECRETS needed:
### SSH_PRIVATE_KEY for Match Repo
### MATCH_PASS
### FIREBASE_TOKEN
### STAGING_FIREBASE_APP_ID
### TEAM_ID

on:
pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: macOS-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Install Firebase-Tools
run: |
yarn global add firebase-tools
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Bundle install
run: bundle install

- name: Cache Pods
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Start Install Script for Template App
run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp

- name: Start Setup Script for Template App Firebase Upload
run: sh set_up_test_firebase.sh
env:
MATCH_REPO: ${{ secrets.MATCH_REPO }}
STAGING_FIREBASE_APP_ID: ${{ secrets.STAGING_FIREBASE_APP_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}

- name: Set Up Test Project for Firebase
run: bundle exec fastlane setUpTestProject

- name: Sync Ad Hoc Code Signing
run: bundle exec fastlane syncAdHocStagingCodeSigning
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- name: Build App and Distribute to Firebase
run: bundle exec fastlane buildStagingAndUploadToFirebase
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ format('v{0}({1})-{2}', env.VERSION_NUMBER, env.BUILD_NUMBER, env.TAG_TYPE) }}
path: |
${{ env.IPA_OUTPUT_PATH }}
${{ env.DSYM_OUTPUT_PATH }}
env:
TAG_TYPE: Staging_Firebase
14 changes: 8 additions & 6 deletions .github/workflows/test_upload_build_to_test_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Test Upload Build to TestFlight
### API_KEY_ID
### ISSUER_ID
### APPSTORE_CONNECT_API_KEY
### TEAM_ID

on:
pull_request
Expand All @@ -18,23 +19,23 @@ concurrency:
jobs:
build:
name: Build
runs-on: macOS-12
runs-on: macOS-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.4
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Bundle install
run: bundle install

- name: Cache Pods
uses: actions/cache@v2
uses: actions/cache@v3
id: cocoapodCache
with:
path: Pods
Expand All @@ -51,12 +52,13 @@ jobs:
MATCH_REPO: ${{ secrets.MATCH_REPO }}
API_KEY_ID: ${{ secrets.API_KEY_ID }}
ISSUER_ID: ${{ secrets.ISSUER_ID }}
TEAM_ID: ${{ secrets.TEAM_ID }}

- name: Set Up Test Project for App Store
run: bundle exec fastlane setUpTestProject

- name: Update Provision Profile
run: bundle exec fastlane updateProvisionSettings
- name: Sync App Store Code Signing
run: bundle exec fastlane syncAppStoreCodeSigning
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

Expand Down
55 changes: 50 additions & 5 deletions fastlane/Constants/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ enum Constant {

// MARK: - Match

static let userName = "<#userName#>"
static let teamId = "<#teamId#>"
static let appleStagingUserName = "<#userName#>"
static let appleStagingTeamId = "<#teamId#>"
static let appleProductionUserName = "<#userName#>"
static let appleProductionTeamId = "<#teamId#>"
static let keychainName = "github_action_keychain"
static let matchURL = "[email protected]:{organization}/{repo}.git"

Expand Down Expand Up @@ -79,11 +81,16 @@ extension Constant {
enum Environment: String {

case staging = "Staging"
case production = ""
case production = "Production"

var productName: String { "\(Constant.projectName) \(rawValue)".trimmed }

var scheme: String { "\(Constant.projectName) \(rawValue)".trimmed }
var scheme: String {
switch self {
case .staging: return "\(Constant.projectName) \(rawValue)".trimmed
case .production: return Constant.projectName.trimmed
}
}

var bundleId: String {
switch self {
Expand Down Expand Up @@ -112,17 +119,55 @@ extension Constant {
let outputDirectoryURL = URL(fileURLWithPath: Constant.outputPath)
return outputDirectoryURL.appendingPathComponent(productName + ".app" + Constant.dSYMSuffix).relativePath
}

var appleUsername: String {
switch self {
case .staging: return Constant.appleStagingUserName
case .production: return Constant.appleProductionUserName
}
}

var appleTeamId: String {
switch self {
case .staging: return Constant.appleStagingTeamId
case .production: return Constant.appleProductionTeamId
}
}
}

enum BuildType: String {

case development
case adHoc = "ad-hoc"
case appStore = "app-store"

var value: String { return rawValue }


var match: String {
switch self {
case .development: return "development"
case .adHoc: return "adhoc"
case .appStore: return "appstore"
}
}

var configuration: String {
switch self {
case .development: return "Debug"
case .adHoc, .appStore: return "Release"
}
}

var codeSignIdentity: String {
switch self {
case .development: return "iPhone Developer"
case .adHoc, . appStore: return "iPhone Distribution"
}
}

var method: String {
switch self {
case .development: return "Development"
case .adHoc: return "AdHoc"
case .appStore: return "AppStore"
}
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Constants/Secret.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum Secret {

static let keychainPassword = EnvironmentParser.string(key: "KEYCHAIN_PASSWORD")

static let firebaseCLIToken = EnvironmentParser.string(key: "FIREBASE_CLI_TOKEN")
static let firebaseCLIToken = EnvironmentParser.string(key: "FIREBASE_TOKEN")

static let appstoreConnectAPIKey = EnvironmentParser.string(key: "APPSTORE_CONNECT_API_KEY")

Expand Down
Loading

0 comments on commit 384dd51

Please sign in to comment.