Skip to content

Commit

Permalink
[D-0] Dev Scheme 추가 (#76)
Browse files Browse the repository at this point in the history
* add: dev scheme 추가

* add: fastfile Dev 업로드 추가

* feat: dev upload를 위해 workflows 수정

* chore: marketingVersion 1.2.1 -> 1.2.2
  • Loading branch information
Siwon-L authored Oct 15, 2024
1 parent 296704f commit db4f4cf
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: UploadTestFlight

on:
push:
branches: [ develop ]
branches: [ develop, main ]

jobs:
upload_testflight:
Expand Down Expand Up @@ -56,7 +56,19 @@ jobs:
- name: Tuist generate
run: tuist generate

- run: fastlane tf
- name: upload TestFlight Prod
if: github.ref == 'refs/heads/main'
run: fastlane tf
env:
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 }}
SLACK_HOOK_URL: ${{ secrets.SLACK_HOOK_URL }}

- name: upload TestFlight Dev
if: github.ref == 'refs/heads/develop'
run: fastlane tfd
env:
KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
Expand Down
22 changes: 20 additions & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ let project = Project(
),
settings: .settings(
base: .init()
.marketingVersion("1.2.1")
.marketingVersion("1.2.2")
.swiftVersion("5.7")
.currentProjectVersion("10")
.currentProjectVersion("1")
.appleGenericVersioningSystem(),
configurations: [
.debug(name: .debug, xcconfig: "Resources/APIKey.xcconfig"),
Expand Down Expand Up @@ -74,6 +74,24 @@ let project = Project(
LaunchArgument(name: "-FIRDebugEnabled", isEnabled: true)
]
)
],
schemes: [
Scheme(
name: "Moneymong",
buildAction: BuildAction(targets: ["Moneymong"]),
runAction: .runAction(configuration: .debug),
archiveAction: .archiveAction(configuration: .release),
profileAction: .profileAction(configuration: .release),
analyzeAction: .analyzeAction(configuration: .debug)
),
Scheme(
name: "Dev-Moneymong",
buildAction: BuildAction(targets: ["Moneymong"]),
runAction: .runAction(configuration: .debug),
archiveAction: .archiveAction(configuration: .debug),
profileAction: .profileAction(configuration: .debug),
analyzeAction: .analyzeAction(configuration: .debug)
)
]
)

Expand Down
56 changes: 55 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,61 @@ platform :ios do
fields: [
{
title: "Scheme",
value: "Release",
value: "#{SCHEME}",
},
{
title: "Build Number",
value: "#{new_build_number.to_s}",
}
]
},
success: true
)
end

# Dev 테스트 플라이트 업로드
desc "Push to TestFlight"
lane :tfd do |options|

ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"

# 앱스토어 커넥트 키 연결
app_store_connect_api_key(
key_id: "#{FASTLANE_API_KEY_ID}",
issuer_id: "#{FASTLANE_API_KEY_ISSUER_ID}",
key_filepath: "fastlane/AuthKey.p8"
)

new_build_number = latest_testflight_build_number + 1

increment_build_number(
build_number: new_build_number,
xcodeproj: "Projects/App/Moneymong.xcodeproj"
)

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

# ✅ 테스트 플라이트 업로드
upload_to_testflight(skip_waiting_for_build_processing: true)
slack(
message: "⭐️ 테스트 플라이트 업로드 성공",
channel: "#알림-ios-배포",
slack_url: "#{SLACK_HOOK_URL}",
username: "대신 배포해주는 고양이",
icon_url: "https://avatars.githubusercontent.com/u/21079970?v=4",
payload: {
"Build Date" => Time.new.to_s,
},
attachment_properties: {
fields: [
{
title: "Scheme",
value: "Dev-#{SCHEME}",
},
{
title: "Build Number",
Expand Down

0 comments on commit db4f4cf

Please sign in to comment.