Skip to content

Instantly share code, notes, and snippets.

@heejongahn
Created August 28, 2019 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save heejongahn/0dc1c36ccef6fb69e209740ec45be25a to your computer and use it in GitHub Desktop.
Save heejongahn/0dc1c36ccef6fb69e209740ec45be25a to your computer and use it in GitHub Desktop.
Flutter 배포 자동화: iOS가 완료된 시점
# .travis.yml
language: generic
env:
- FLUTTER_BUILD_RELEASE_CHANNEL=stable # 사용할 빌드 릴리즈 채널
matrix:
include:
- name: iOS Build
os: osx
language: generic
osx_image: xcode10.2
before_script:
- echo -e "machine github.com\n login $GITHUB_TOKEN" >> ~/.netrc # match 인증서 저장소에 접근하기 위해 GitHub Token 설치
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_BUILD_RELEASE_CHANNEL
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH # Flutter를 내려받은 후 PATH 설정
- gem install bundler
- gem install cocoapods
- cd ios && bundle install && cd .. # bundler, cocoapods 및 fastlane 설치
script:
- flutter doctor -v # 빌드 디버깅을 위한 Flutter 정보 로깅
- bash scripts/populate_secret.sh # 써드파티 라이브러리 시크릿 파일로
- flutter build ios --no-codesign --build-number=$TRAVIS_BUILD_NUMBER # Flutter iOS 빌드에 필요한 파일을 내려받고 번들의 빌드 이름 및 빌드 번호 설정
- cd ios
- bundle exec fastlane beta # fastlane을 사용한 코드 사이닝, 빌드 및 TestFligth 배포
# ios/fastlane/Appfile
app_identifier("번들 식별자")
apple_id("애플 이메일 계정")
itc_team_id("앱 스토어 커넥트 Team ID")
team_id("Developer Portal Team ID")
# ios/fastlane/Fastfile
default_platform(:ios)
platform :ios do
desc "Push a new release build to the TestFlight"
lane :beta do
setup_travis
match(
type: "appstore",
readonly: is_ci,
verbose: true
)
build_app(workspace: "Runner.xcworkspace", scheme: "Runner")
upload_to_testflight(
skip_waiting_for_build_processing: true,
apple_id: "배포하려는 앱의 apple id"
)
end
end
# ios/fastlane/Matchfile
git_url("https://github.com/myaccount/my-account-cert")
storage_mode("git")
type("appstore")
app_identifier("번들 식별자")
username("애플 이메일 계정")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment