Skip to content

Commit 1a77416

Browse files
committed
feat: 런타임에 필요한 파일들을 private 리포에서 가져오도록 추가
1 parent 913934f commit 1a77416

4 files changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Install Private Config
2+
description: Fetch Config.xcconfig and GoogleService-Info.plist from a private repository.
3+
4+
inputs:
5+
git_url:
6+
description: Private repository git URL
7+
required: true
8+
git_basic_authorization:
9+
description: Base64-encoded basic authorization header value
10+
required: true
11+
ref:
12+
description: Git ref to fetch from the private repository
13+
required: false
14+
default: iOS
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- name: Install private config files
20+
shell: bash
21+
env:
22+
PRIVATE_CONFIG_GIT_URL: ${{ inputs.git_url }}
23+
PRIVATE_CONFIG_GIT_BASIC_AUTHORIZATION: ${{ inputs.git_basic_authorization }}
24+
PRIVATE_CONFIG_REF: ${{ inputs.ref }}
25+
run: |
26+
set -euo pipefail
27+
28+
privateConfigCheckoutPath="$RUNNER_TEMP/private-config"
29+
configSourcePath="$privateConfigCheckoutPath/resources/DevLog/Config.xcconfig"
30+
googleServiceInfoSourcePath="$privateConfigCheckoutPath/resources/DevLog/GoogleService-Info.plist"
31+
configDestinationPath="$GITHUB_WORKSPACE/DevLog/Resource/Config.xcconfig"
32+
googleServiceInfoDestinationPath="$GITHUB_WORKSPACE/DevLog/Resource/GoogleService-Info.plist"
33+
34+
rm -rf "$privateConfigCheckoutPath"
35+
mkdir -p "$privateConfigCheckoutPath"
36+
37+
git init "$privateConfigCheckoutPath"
38+
git -C "$privateConfigCheckoutPath" remote add origin "$PRIVATE_CONFIG_GIT_URL"
39+
git -C "$privateConfigCheckoutPath" config core.sparseCheckout true
40+
printf '%s\n' \
41+
'resources/DevLog/Config.xcconfig' \
42+
'resources/DevLog/GoogleService-Info.plist' \
43+
> "$privateConfigCheckoutPath/.git/info/sparse-checkout"
44+
45+
git -C "$privateConfigCheckoutPath" \
46+
-c http.extraheader="Authorization: Basic $PRIVATE_CONFIG_GIT_BASIC_AUTHORIZATION" \
47+
fetch --depth 1 origin "$PRIVATE_CONFIG_REF"
48+
git -C "$privateConfigCheckoutPath" checkout FETCH_HEAD
49+
50+
if [ ! -f "$configSourcePath" ]; then
51+
echo "Missing private config file at $configSourcePath" >&2
52+
exit 1
53+
fi
54+
55+
if [ ! -f "$googleServiceInfoSourcePath" ]; then
56+
echo "Missing private GoogleService-Info.plist at $googleServiceInfoSourcePath" >&2
57+
exit 1
58+
fi
59+
60+
install -m 600 "$configSourcePath" "$configDestinationPath"
61+
install -m 600 "$googleServiceInfoSourcePath" "$googleServiceInfoDestinationPath"
62+
63+
- name: Clean private config checkout
64+
shell: bash
65+
run: rm -rf "$RUNNER_TEMP/private-config"

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
env:
77
SCHEME: DevLog
88
XCODE_VERSION: latest
9+
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
10+
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
911

1012
permissions:
1113
contents: read
@@ -49,6 +51,12 @@ jobs:
4951
steps:
5052
- uses: actions/checkout@v4
5153

54+
- name: Install private config files
55+
uses: ./.github/actions/install-private-config
56+
with:
57+
git_url: ${{ env.MATCH_GIT_URL }}
58+
git_basic_authorization: ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }}
59+
5260
- name: Set up Xcode
5361
uses: maxim-lobanov/setup-xcode@v1
5462
with:

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
with:
3535
ref: ${{ github.event.pull_request.merge_commit_sha }}
3636

37+
- name: Install private config files
38+
uses: ./.github/actions/install-private-config
39+
with:
40+
git_url: ${{ env.MATCH_GIT_URL }}
41+
git_basic_authorization: ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }}
42+
3743
- name: Set up Ruby
3844
uses: ruby/setup-ruby@v1
3945
with:

.github/workflows/testflight.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v4
3232

33+
- name: Install private config files
34+
uses: ./.github/actions/install-private-config
35+
with:
36+
git_url: ${{ env.MATCH_GIT_URL }}
37+
git_basic_authorization: ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }}
38+
3339
- name: Set up Xcode
3440
uses: maxim-lobanov/setup-xcode@v1
3541
with:
@@ -61,6 +67,12 @@ jobs:
6167
- name: Checkout
6268
uses: actions/checkout@v4
6369

70+
- name: Install private config files
71+
uses: ./.github/actions/install-private-config
72+
with:
73+
git_url: ${{ env.MATCH_GIT_URL }}
74+
git_basic_authorization: ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }}
75+
6476
- name: Set up Ruby
6577
uses: ruby/setup-ruby@v1
6678
with:

0 commit comments

Comments
 (0)