Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- stack
- appstore
- 웹뷰
- darkmode
- window
- 한글
- Git
- github
- iOS16
- view
- 개발자
- mac
- Swift
- Code
- UIButton
- IOS
- error
- Firebase
- FLUTTER
- Python
- SwiftUI
- Archive
- JPA
- Apple
- Xcode
- Realm
- Session
- MacOS
- Notification
- rxswift
Archives
- Today
- Total
EEYatHo 앱 깎는 이야기
Git ) GithubAction - EEYatHo iOS 본문
반응형
나중에 시간 지나서 보면, 잘 할 수 있도록 기록하는 용도.
.github/workflows/swift.yml 에 있는 파일로 여러 스크립트나 옵션들 설정 가능.
gpg로 필요한 certification 이랑, provision 암호화하고 .github/secrets에 올림.
복호화에 필요한 정보는 깃헙액션 옵션에 secrets에 올림.
name: Swift
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: macos-latest # macOS 최신버전이서 빌드한다는 뜻
env:
XC_VERSION: ${{ '12.5.1' }}
XC_PROJECT: ${{ 'Nemo.xcworkspace' }}
XC_SCHEME: ${{ 'Nemo' }}
XC_ARCHIVE_PATH: ${{ 'Nemo.xcarichive' }}
XC_EXPORT_PATH: ${{ './artifacts' }}
KEYCHAIN: ${{ 'test.keychain' }}
DECRYPTED_CERTS_FILE_PATH: ${{ '.github/secrets/distribution.p12' }}
ENCRYPTED_CERTS_FILE_PATH: ${{ '.github/secrets/distribution.p12.gpg' }}
DECRYPTED_PROVISION_FILE_PATH: ${{ '.github/secrets/githubAction.mobileprovision' }}
ENCRYPTED_PROVISION_FILE_PATH: ${{ '.github/secrets/githubAction.mobileprovision.gpg' }}
CERT_ENCRYPTION_PWD: ${{ secrets.CERT_ENCRYPTION_PWD }}
PROVISION_ENCRYPTION_PWD: ${{ secrets.PROVISION_ENCRYPTION_PWD }}
CERT_EXPORT_PWD: ${{ secrets.CERT_EXPORT_PWD }}
steps:
- uses: actions/checkout@v2 # 여기에 코드를 복사하여 테스트를 진행
- name: 임시 키체인 생성 # 작업의 이름
run: | # 작업 명령어들
security create-keychain -p "" "$KEYCHAIN"
security list-keychains -s "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
security unlock-keychain -p "" "$KEYCHAIN"
security set-keychain-settings
gpg -d -o "$DECRYPTED_CERTS_FILE_PATH" --pinentry-mode=loopback --passphrase "$CERT_ENCRYPTION_PWD" "$ENCRYPTED_CERTS_FILE_PATH"
gpg -d -o "$DECRYPTED_PROVISION_FILE_PATH" --pinentry-mode=loopback --passphrase "$PROVISION_ENCRYPTION_PWD" "$ENCRYPTED_PROVISION_FILE_PATH"
security import "$DECRYPTED_CERTS_FILE_PATH" -k "$KEYCHAIN" -P "$CERT_EXPORT_PWD" -A
security set-key-partition-list -S apple-tool:,apple: -s -k "" "$KEYCHAIN"
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
cd ".github/secrets"
echo `ls *.mobileprovision`
for PROVISION in `ls *.mobileprovision`
do
echo Hello, world!
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)`
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision"
done
- name: pod install 실행
run: |
pod install --repo-update --clean-install
# name 새로 하면, 원래 경로로 초기화됨
- name: 아카이브 생성
run: |
mkdir artifacts
xcodebuild archive -workspace Nemo.xcworkspace -scheme Nemo -configuration release -archivePath Nemo.xcarchive
- name: ExportOptions.plist 생성
run: |
cat << EOF > ExportOptions.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>[teamID]</string>
<key>uploadBitcode</key>
<true/>
<key>compileBitcode</key>
<true/>
<key>uploadSymbols</key>
<true/>
<key>signingStyle</key>
<string>manual</string>
<key>signingCertificate</key>
<string>Apple Distribution</string>
<key>provisioningProfiles</key>
<dict>
<key>[Bundle ID]</key>
<string>githubAction</string>
</dict>
</dict>
</plist>
EOF
- name: ipa 생성
run: |
xcodebuild -exportArchive -archivePath Nemo.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath "$XC_EXPORT_PATH"
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: ./artifacts
'Git' 카테고리의 다른 글
Git ) GithubAction2 - EEYatHo iOS (0) | 2021.09.06 |
---|---|
Git ) git 툴 특징, 차이점 ( cmd, xcode, sourceTree ) - EEYatHo iOS (0) | 2021.08.09 |
Git ) Git Config - EEYatHo iOS (0) | 2021.04.28 |
Git ) macOS에서 커맨드로 git 사용시 계정 변경하는 법 - EEYatHo iOS (0) | 2021.04.23 |
Git ) .gitignore 적용되는 파일, 안되는 파일 - EEYatHo iOS (0) | 2021.04.23 |
Comments