Skip to content

Commit

Permalink
[#492] Create SetUpTestTestFlight.swift
Browse files Browse the repository at this point in the history
Remove set_up_test_test_flight.sh
Update workflow to use the SetUpTestTestFlight.swift
  • Loading branch information
ducbm051291 committed Aug 10, 2023
1 parent da4526d commit cba1e35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_upload_build_to_test_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: sh make.sh --bundle-id co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp --interface UIKit

- name: Start Setup Script for Template App TestFlight Upload
run: sh set_up_test_testflight.sh
run: cat Scripts/Swift/SetUpTestTestFlight.swift Scripts/Swift/Extensions/FileManager+Utils.swift | swift -
env:
MATCH_REPO: ${{ secrets.MATCH_REPO }}
API_KEY_ID: ${{ secrets.API_KEY_ID }}
Expand Down
16 changes: 16 additions & 0 deletions Scripts/Swift/SetUpTestTestFlight.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let teamIdPlaceholder = "<#teamId#>"
let apiKeyIdPlaceholder = "<#API_KEY_ID#>"
let issuerIdPlaceholder = "<#ISSUER_ID#>"
let matchRepoPlaceholder = "[email protected]:{organization}/{repo}.git"

let envMatchRepo = ProcessInfo.processInfo.environment["MATCH_REPO"] ?? ""
let envApiKey = ProcessInfo.processInfo.environment["API_KEY_ID"] ?? ""
let envIssuerId = ProcessInfo.processInfo.environment["ISSUER_ID"] ?? ""
let envTeamId = ProcessInfo.processInfo.environment["TEAM_ID"] ?? ""

let fileManager = FileManager.default

fileManager.replaceAllOccurrences(of: teamIdPlaceholder, to: envTeamId)
fileManager.replaceAllOccurrences(of: apiKeyIdPlaceholder, to: envApiKey)
fileManager.replaceAllOccurrences(of: issuerIdPlaceholder, to: envIssuerId)
fileManager.replaceAllOccurrences(of: matchRepoPlaceholder, to: envMatchRepo)
12 changes: 0 additions & 12 deletions set_up_test_testflight.sh

This file was deleted.

0 comments on commit cba1e35

Please sign in to comment.