-
Notifications
You must be signed in to change notification settings - Fork 0
[#258] 런타임에 필요한 파일들이 리포에 올라오지 않아 CD 후 크래시가 나는 이슈를 해결한다 #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Install Private Config | ||
| description: Fetch Config.xcconfig and GoogleService-Info.plist from a private repository. | ||
|
|
||
| inputs: | ||
| git_url: | ||
| description: Private repository git URL | ||
| required: true | ||
| git_basic_authorization: | ||
| description: Base64-encoded basic authorization header value | ||
| required: true | ||
| ref: | ||
| description: Git ref to fetch from the private repository | ||
| required: false | ||
| default: iOS | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install private config files | ||
| shell: bash | ||
| env: | ||
| PRIVATE_CONFIG_GIT_URL: ${{ inputs.git_url }} | ||
| PRIVATE_CONFIG_GIT_BASIC_AUTHORIZATION: ${{ inputs.git_basic_authorization }} | ||
| PRIVATE_CONFIG_REF: ${{ inputs.ref }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| privateConfigCheckoutPath="$RUNNER_TEMP/private-config" | ||
| trap 'rm -rf "$privateConfigCheckoutPath"' EXIT | ||
| configSourcePath="$privateConfigCheckoutPath/resources/DevLog/Config.xcconfig" | ||
| googleServiceInfoSourcePath="$privateConfigCheckoutPath/resources/DevLog/GoogleService-Info.plist" | ||
| configDestinationPath="$GITHUB_WORKSPACE/DevLog/Resource/Config.xcconfig" | ||
| googleServiceInfoDestinationPath="$GITHUB_WORKSPACE/DevLog/Resource/GoogleService-Info.plist" | ||
|
|
||
| rm -rf "$privateConfigCheckoutPath" | ||
| mkdir -p "$privateConfigCheckoutPath" | ||
|
|
||
| git init "$privateConfigCheckoutPath" | ||
| git -C "$privateConfigCheckoutPath" remote add origin "$PRIVATE_CONFIG_GIT_URL" | ||
| git -C "$privateConfigCheckoutPath" config core.sparseCheckout true | ||
| printf '%s\n' \ | ||
| 'resources/DevLog/Config.xcconfig' \ | ||
| 'resources/DevLog/GoogleService-Info.plist' \ | ||
| > "$privateConfigCheckoutPath/.git/info/sparse-checkout" | ||
|
|
||
| git -C "$privateConfigCheckoutPath" \ | ||
| -c http.extraheader="Authorization: Basic $PRIVATE_CONFIG_GIT_BASIC_AUTHORIZATION" \ | ||
| fetch --depth 1 origin "$PRIVATE_CONFIG_REF" | ||
| git -C "$privateConfigCheckoutPath" checkout FETCH_HEAD | ||
|
|
||
| if [ ! -f "$configSourcePath" ]; then | ||
| echo "Missing private config file at $configSourcePath" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -f "$googleServiceInfoSourcePath" ]; then | ||
| echo "Missing private GoogleService-Info.plist at $googleServiceInfoSourcePath" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| install -m 600 "$configSourcePath" "$configDestinationPath" | ||
| install -m 600 "$googleServiceInfoSourcePath" "$googleServiceInfoDestinationPath" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ node_modules/ | |
| lib/ | ||
|
|
||
| # Gem | ||
| .bundle/ | ||
| vendor/bundle/ | ||
|
|
||
| # Fastlane | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스크립트가 중간에 실패할 경우 임시 디렉터리가 정리되지 않고 남을 수 있습니다.
trap을 사용하여 스크립트가 어떤 이유로든 종료될 때 항상 임시 디렉터리가 삭제되도록 하는 것이 더 안전하고 견고합니다.