Skip to content

Commit

Permalink
Merge pull request #136 from YAPP-Github/feature/#135-cicd-improvement
Browse files Browse the repository at this point in the history
CI/CD 및 μ½”λ“œ 사이닝 κ°œμ„ 
  • Loading branch information
ShapeKim98 authored Oct 6, 2024
2 parents d9704db + 57f24ab commit c0ab92f
Show file tree
Hide file tree
Showing 17 changed files with 162 additions and 158 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: hotfix
name: appstore-release

on:
push:
branches: [ "hotfix/*" ]
pull_request:
branches:
- main

jobs:
build:
Expand All @@ -17,12 +18,12 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
xcode-version: latest-stable

# - uses: shimataro/ssh-key-action@v2
# with:
# key: ${{ secrets.SSH_KEY }}
# known_hosts: ${{ secrets.KNOWN_HOSTS }}
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: initial mise
run: |
Expand All @@ -36,10 +37,10 @@ jobs:
- name: Generate Project
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_URL: ${{ secrets.MATCH_URL }}
APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
run: fastlane generate
run: |
fastlane appstore_profile
make release
- name: Build Archive
env:
Expand All @@ -48,9 +49,9 @@ jobs:
APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }}
run: fastlane archive

- name: Beta Release
- name: Appstore Release
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }}
run: fastlane release
run: fastlane appstore_release
13 changes: 8 additions & 5 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ name: build-test

on:
pull_request:
branches: [ "develop" ]
branches:
- develop

workflow_dispatch:

jobs:
build:
Expand All @@ -17,7 +20,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
xcode-version: latest-stable

- uses: shimataro/ssh-key-action@v2
with:
Expand All @@ -36,10 +39,10 @@ jobs:
- name: Test Generate
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_URL: ${{ secrets.MATCH_URL }}
APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
run: fastlane test
run: |
fastlane development_profile
make test
- name: Build Test
run: fastlane build
31 changes: 31 additions & 0 deletions .github/workflows/release_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: release-update

on:
pull_request:
branches:
- main
types:
- closed

jobs:
release-update:
if: ${{ github.event.pull_request.merged == true }}
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Install GitHub CLI
run: sudo apt-get install gh

- name: Update Release
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: fastlane update_github_release
24 changes: 15 additions & 9 deletions .github/workflows/testflight_release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: testflight_release
name: testflight-release

on:
push:
branches: [ "develop" ]
pull_request:
branches:
- develop
types:
- closed

workflow_dispatch:

jobs:
build:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
runs-on: macos-latest

steps:
Expand All @@ -17,7 +23,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
xcode-version: latest-stable

- uses: shimataro/ssh-key-action@v2
with:
Expand All @@ -36,10 +42,10 @@ jobs:
- name: Generate Project
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_URL: ${{ secrets.MATCH_URL }}
APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
run: fastlane generate
run: |
fastlane appstore_profile
make release
- name: Build Archive
env:
Expand All @@ -48,9 +54,9 @@ jobs:
APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }}
run: fastlane archive

- name: Beta Release
- name: Testflight Release
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_API: ${{ secrets.APP_STORE_CONNECT_API }}
run: fastlane release
run: fastlane testflight_release
67 changes: 0 additions & 67 deletions .github/workflows/workflow_test.yml

This file was deleted.

9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ download-privates:
@if [ ! -d "Pokit_iOS_Private" ]; then \
git clone git@github.com:stealmh/Pokit_iOS_Private.git; \
fi
@if [ -f "Pokit_iOS_Private/xcconfig/Secret.xcconfig" ]; then \
@if [ -f "Pokit_iOS_Private/xcconfig/Debug.xcconfig" ] && [ -f "Pokit_iOS_Private/xcconfig/Release.xcconfig" ]; then \
mkdir -p xcconfig; \
cp Pokit_iOS_Private/xcconfig/Secret.xcconfig xcconfig/Secret.xcconfig; \
cp Pokit_iOS_Private/xcconfig/Debug.xcconfig xcconfig/Debug.xcconfig; \
cp Pokit_iOS_Private/xcconfig/Release.xcconfig xcconfig/Release.xcconfig; \
cp Pokit_iOS_Private/auth/AuthKey.p8 Projects/CoreKit/Resources/AuthKey.p8; \
cp Pokit_iOS_Private/GoogleService-Info.plist Projects/App/Resources/GoogleService-Info.plist; \
rm -rf Pokit_iOS_Private; \
echo "βœ… Secret νŒŒμΌμ„ μ„±κ³΅μ μœΌλ‘œ λ‹€μš΄λ‘œλ“œν•˜κ³  Pokit_iOS_Private 폴더λ₯Ό μ‚­μ œν–ˆμŠ΅λ‹ˆλ‹€."; \
echo "βœ… Debug.xcconfig와 Release.xcconfig νŒŒμΌμ„ μ„±κ³΅μ μœΌλ‘œ λ‹€μš΄λ‘œλ“œν•˜κ³  Pokit_iOS_Private 폴더λ₯Ό μ‚­μ œν–ˆμŠ΅λ‹ˆλ‹€."; \
else \
echo "❌ Secret.xcconfig νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."; \
echo "❌ Debug.xcconfig λ˜λŠ” Release.xcconfig νŒŒμΌμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€." && exit 1; \
fi
18 changes: 7 additions & 11 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ let project = Project(
.external(name: "FirebaseMessaging")
],
settings: .settings(
base: [
"OTHER_LDFLAGS": "$(inherited) -ObjC",
"CODE_SIGN_IDENTITY": "Apple Distribution",
"PROVISIONING_PROFILE_SPECIFIER": "match AppStore com.pokitmons.pokit 1721720816",
"PROVISIONING_PROFILE": "match AppStore com.pokitmons.pokit 1721720816",
"DEVELOPMENT_TEAM": "\(developmentTeam ?? "")"
],
configurations: [
.debug(name: "Debug", xcconfig: .relativeToRoot("xcconfig/Secret.xcconfig")),
.release(name: "Release", xcconfig: .relativeToRoot("xcconfig/Secret.xcconfig"))
]
.release(
name: "Release",
settings: [
"CODE_SIGN_IDENTITY": "Apple Distribution"
],
xcconfig: .relativeToRoot("xcconfig/Release.xcconfig")
)
)
)
]
Expand Down
11 changes: 1 addition & 10 deletions Projects/CoreKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,10 @@ let coreKit: Target = .target(
.external(name: "KakaoSDKShare"),
.external(name: "KakaoSDKTemplate"),
],
settings: .settings(
base: [
"OTHER_LDFLAGS": "$(inherited) -ObjC",
],
configurations: [
.debug(name: "Debug", xcconfig: .relativeToRoot("xcconfig/Secret.xcconfig")),
.release(name: "Release", xcconfig: .relativeToRoot("xcconfig/Secret.xcconfig"))
]
)
settings: .settings()
)

let project = Project(
name: "CoreKit",
settings: .settings,
targets: [coreKit]
)
3 changes: 2 additions & 1 deletion Projects/DSKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ let project = Project(
// TODO: μ˜μ‘΄μ„± μΆ”κ°€
.project(target: "Util", path: .relativeToRoot("Projects/Util")),
.external(name: "NukeUI")
]
],
settings: .settings()
)
]
)
2 changes: 1 addition & 1 deletion Projects/Domain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let project = Project(
.project(target: "SharedThirdPartyLib", path: .relativeToRoot("Projects/SharedThirdPartyLib")),
.project(target: "CoreKit", path: .relativeToRoot("Projects/CoreKit"))
],
settings: .settings
settings: .settings()
)
]
)
2 changes: 1 addition & 1 deletion Projects/SharedThirdPartyLib/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let project = Project(
// TODO: μ˜μ‘΄μ„± μΆ”κ°€
.external(name: "ComposableArchitecture")
],
settings: .settings
settings: .settings()
)
]
)
3 changes: 2 additions & 1 deletion Projects/Util/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ let project = Project(
sources: ["Sources/**"],
dependencies: [
// TODO: μ˜μ‘΄μ„± μΆ”κ°€
]
],
settings: .settings()
)
]
)
14 changes: 12 additions & 2 deletions Tuist/ProjectDescriptionHelpers/Settings+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
import ProjectDescription

public extension Settings {
static var settings: Settings {
return .settings(
static func settings(_ release: Configuration? = nil) -> Settings {
var settings: Settings = .settings(
base: [
"OTHER_LDFLAGS": "$(inherited) -ObjC",
"CODE_SIGN_STYLE": "Manual"
],
configurations: [
.debug(name: "Debug", xcconfig: .relativeToRoot("xcconfig/Debug.xcconfig"))
]
)

if let release {
settings.configurations.append(release)
}

return settings
}
}
4 changes: 2 additions & 2 deletions Tuist/ProjectDescriptionHelpers/Target+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public extension Target {
sources: ["\(name)/Sources/**"],
resources: resources,
dependencies: dependencies,
settings: .settings
settings: .settings()
)
}

Expand All @@ -44,7 +44,7 @@ public extension Target {
deploymentTargets: .appMinimunTarget,
sources: ["Sources/\(name)/Sources/**"],
dependencies: dependencies,
settings: .settings
settings: .settings()
)
}
}
Loading

0 comments on commit c0ab92f

Please sign in to comment.