Skip to content

Commit

Permalink
�Fix: Tuist Signing -> Match 인증 방식 변경(527) (#79)
Browse files Browse the repository at this point in the history
* chore: Tuist Signing 폴더 삭제

* fix: tuist Siging -> fastlane match로 사이닝 방식 변경

* feat: tuist 수동으로 인증서 설정

* fix: tuist Signing -> match 변경으로 인한 main.yml 파일 수정

* fix: AuthKey 무효화 및 새 content key 발급 + 숨김처리

* chore: github action target 브랜치 epic/CD 추가

* chore: env MATCH_PASSWORD 시크릿 key 추가
  • Loading branch information
Siwon-L committed Nov 17, 2024
1 parent 52cd717 commit 9750e37
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 52 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ name: UploadTestFlight

on:
push:
branches: [ develop ]
branches: [ develop, epic/CD ]

jobs:
upload_testflight:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4.0

- name: Setting Master Key
run: |
echo "$MASTER_KEY" > Tuist/master.key
env:
MASTER_KEY: ${{secrets.MASTER_KEY}}
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Install Tuist
run: brew tap tuist/tuist
Expand All @@ -37,9 +34,6 @@ jobs:

- name: Tuist fetch
run: tuist fetch

- name: Tuist Signing Decrypt
run: tuist signing decrypt

- name: Set Keychain
run: fastlane set_keychain
Expand All @@ -58,8 +52,10 @@ jobs:

- run: fastlane tf
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
FASTLANE_API_KEY_ID: ${{ secrets.FASTLANE_API_KEY_ID }}
FASTLANE_API_KEY_ISSUER_ID: ${{ secrets.FASTLANE_API_KEY_ISSUER_ID }}
FASTLANE_API_KEY_CONTENT: ${{ secrets.FASTLANE_API_KEY_CONTENT }}
SLACK_HOOK_URL: ${{ secrets.SLACK_HOOK_URL }}
47 changes: 34 additions & 13 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let project = Project(
),
settings: .settings(
base: .init()
.marketingVersion("1.3.0")
.marketingVersion("1.3.2")
.swiftVersion("5.7")
.currentProjectVersion("1")
.appleGenericVersioningSystem(),
Expand All @@ -35,7 +35,23 @@ let project = Project(
entitlements: "WidgetExtension/Resources/WidgetExtension.entitlements",
dependencies: [
.project(target: "DesignSystem", path: .relativeToRoot("Projects/Shared/DesignSystem"))
]
],
settings: .settings(
base: [
"DEVELOPMENT_TEAM[sdk=iphoneos*]": "H5G7RFWFSQ",
"CODE_SIGN_STYLE": "Manual"
],
configurations: [
.debug(name: "Debug", settings: [
"CODE_SIGN_IDENTITY": "Apple Development: Nayeon Gu (3CMPGMMD7L)",
"PROVISIONING_PROFILE_SPECIFIER": "match Development com.yapp.moneymong.WidgetExtension"
]),
.release(name: "Release", settings: [
"CODE_SIGN_IDENTITY": "Apple Distribution: Nayeon Gu (H5G7RFWFSQ)",
"PROVISIONING_PROFILE_SPECIFIER": "match AppStore com.yapp.moneymong.WidgetExtension"
])
]
)
),
Target(
name: "Moneymong",
Expand Down Expand Up @@ -86,8 +102,22 @@ let project = Project(
.target(name: "WidgetExtension")
],
settings: .settings(
base: .init()
.cutomSetting()
base: [
"DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym",
"OTHER_LDFLAGS": "-ObjC",
"DEVELOPMENT_TEAM[sdk=iphoneos*]": "H5G7RFWFSQ",
"CODE_SIGN_STYLE": "Manual"
],
configurations: [
.debug(name: "Debug", settings: [
"CODE_SIGN_IDENTITY": "Apple Development: Nayeon Gu (3CMPGMMD7L)",
"PROVISIONING_PROFILE_SPECIFIER": "match Development com.yapp.moneymong"
]),
.release(name: "Release", settings: [
"CODE_SIGN_IDENTITY": "Apple Distribution: Nayeon Gu (H5G7RFWFSQ)",
"PROVISIONING_PROFILE_SPECIFIER": "match AppStore com.yapp.moneymong"
])
]
),
launchArguments: [
LaunchArgument(name: "IDEPreferLogStreaming=YES", isEnabled: true),
Expand All @@ -96,12 +126,3 @@ let project = Project(
)
]
)

extension Dictionary where Key == String, Value == ProjectDescription.SettingValue {
func cutomSetting() -> SettingsDictionary {
return merging([
"DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym",
"OTHER_LDFLAGS": "-ObjC"
])
}
}
Binary file removed Tuist/Signing/Moneymong.Debug.mobileprovision
Binary file not shown.
Binary file removed Tuist/Signing/Moneymong.Release.mobileprovision
Binary file not shown.
1 change: 0 additions & 1 deletion Tuist/Signing/debug.cer.encrypted

This file was deleted.

1 change: 0 additions & 1 deletion Tuist/Signing/debug.p12.encrypted

This file was deleted.

1 change: 0 additions & 1 deletion Tuist/Signing/release.cer.encrypted

This file was deleted.

1 change: 0 additions & 1 deletion Tuist/Signing/release.p12.encrypted

This file was deleted.

6 changes: 0 additions & 6 deletions fastlane/AuthKey.p8

This file was deleted.

48 changes: 31 additions & 17 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SLACK_HOOK_URL = ENV["SLACK_HOOK_URL"]

FASTLANE_API_KEY_ID = ENV["FASTLANE_API_KEY_ID"]
FASTLANE_API_KEY_ISSUER_ID = ENV["FASTLANE_API_KEY_ISSUER_ID"]
FASTLANE_API_KEY_CONTENT = ENV["FASTLANE_API_KEY_CONTENT"]

default_platform(:ios)

Expand All @@ -22,20 +23,6 @@ platform :ios do
timeout: 3600,
lock_when_sleeps: true
)

import_certificate(
certificate_path: "Tuist/Signing/release.cer",
keychain_name: "#{KEYCHAIN_NAME}",
keychain_password: "#{KEYCHAIN_PASSWORD}"
)

import_certificate(
certificate_path: "Tuist/Signing/release.p12",
keychain_name: "#{KEYCHAIN_NAME}",
keychain_password: "#{KEYCHAIN_PASSWORD}"
)

install_provisioning_profile(path: "Tuist/Signing/#{APP_NAME}.Release.mobileprovision")
end

# 테스트 플라이트 업로드
Expand All @@ -48,7 +35,7 @@ platform :ios do
app_store_connect_api_key(
key_id: "#{FASTLANE_API_KEY_ID}",
issuer_id: "#{FASTLANE_API_KEY_ISSUER_ID}",
key_filepath: "fastlane/AuthKey.p8"
key_content: "#{FASTLANE_API_KEY_CONTENT}"
)

new_build_number = latest_testflight_build_number + 1
Expand All @@ -58,15 +45,42 @@ platform :ios do
xcodeproj: "Projects/App/Moneymong.xcodeproj"
)

match(
git_url: "[email protected]:MONEYMONG/iOS-Moneymong-Match.git",
storage_mode: "git",
type: "appstore",
app_identifier: "com.yapp.moneymong",
force_for_new_devices: true,
readonly: true
keychain_name: "#{KEYCHAIN_NAME}",
keychain_password: "#{KEYCHAIN_PASSWORD}"
)

match(
git_url: "[email protected]:MONEYMONG/iOS-Moneymong-Match.git",
storage_mode: "git",
type: "appstore",
app_identifier: "com.yapp.moneymong.WidgetExtension",
force_for_new_devices: true,
readonly: true
keychain_name: "#{KEYCHAIN_NAME}",
keychain_password: "#{KEYCHAIN_PASSWORD}"
)

# ✅ 빌드
build_app(
workspace: "#{APP_NAME}.xcworkspace",
scheme: "#{SCHEME}",
export_method: "app-store"
export_method: "app-store",
xcargs: "-allowProvisioningUpdates"
)

# ✅ 테스트 플라이트 업로드
upload_to_testflight(skip_waiting_for_build_processing: true)
upload_to_testflight(
app_identifier: "com.yapp.moneymong",
skip_waiting_for_build_processing: true
)

slack(
message: "⭐️ 테스트 플라이트 업로드 성공",
channel: "#알림-ios-배포",
Expand Down
Loading

0 comments on commit 9750e37

Please sign in to comment.