Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automated releasing iOS app with Travis CI

Automated releasing iOS app with Travis CI

How to automate releasing iOS app with Travis CI

9bf923e39671cde83584e3e926296c13?s=128

Kishikawa Katsumi

September 17, 2014
Tweet

Transcript

  1. "VUPNBUFESFMFBTJOH J04BQQXJUI5SBWJT$* JO6CJSFHJ*OD

  2. kishikawa katsumi http://kishikawakatsumi.com Twitter @k_katsumi https://github.com/kishikawakatsumi http://d.hatena.ne.jp/KishikawaKatsumi/

  3. %JTUSJCVUF 1VMM3FRVFTU /JHIUMZ#VJME $SBTI3FQPSU 5FTU 5FTUBQQMJDBUJPO%JTUSJCVUFCFUB

  4. "VUPNBUJOH3FMFBTF 1SPDFTT

  5. #VJMEGPSSFMFBTF 2"UFTUJOH $SBTI3FQPSU 4VCNJU

  6. #VJMEGPSSFMFBTF 2"UFTUJOH $SBTI3FQPSU 4VCNJU

  7. language: objective-c cache: directories: - vendor/bundle - Pods install: -

    bundle install --path=vendor/bundle --binstubs=vendor/bin - bundle exec pod install script: - bundle exec rake ACTION after_success: - 'bundle exec travis-artifacts upload --path Ubiregi2.xcarchive.zip --target-path' env: global: - LANG=en_US.UTF-8 - LC_ALL=en_US.UTF-8 matrix: - ACTION="profile:install certificate:add distribute:CONFIG certificate:remove" - ACTION=test
  8. $ bundle exec rake -T rake archive # Build artifacts

    (.xcarchive, ipa) (Release) rake build # Build application (Release)e) rake clean # Remove any temporary products rake distribute # Upload IPA file to TestFlight (Release)rake profile:download # Download provisioning profiles from ADC rake release # Submit application rake setup # Setting up a development environment rake test # Test application rake version # Print the current version rake version:bump:major # Bump major version (X.00) rake version:bump:minor # Bump minor version (0.XX) rake version:bump:release # Bump release version (0.XY) rake version:current # Print the current version rake version:set_build_version # Sets build version to last git commit
  9. $ bundle exec rake -T rake archive # Build artifacts

    (.xcarchive, ipa) (Release) rake build # Build application (Release)e) rake clean # Remove any temporary products rake distribute # Upload IPA file to TestFlight (Release)rake profile:download # Download provisioning profiles from ADC rake release # Submit application rake setup # Setting up a development environment rake test # Test application rake version # Print the current version rake version:bump:major # Bump major version (X.00) rake version:bump:minor # Bump minor version (0.XX) rake version:bump:release # Bump release version (0.XY) rake version:current # Print the current version rake version:set_build_version # Sets build version to last git commit
  10. task distribute: ["distribute:release"] ! namespace :distribute do task :release =>

    ["archive:release"] do distribute end ! task :adhoc => ["version:set_build_version", "archive:adhoc"] do distribute end end
  11. def archive(configuration: "Release") build_xcarchive(configuration: configuration) export_ipa zip_dsyms end

  12. xcodebuild -sdk “iphoneos" -workspace “Ubiregi2.xcworkspace" -scheme “Ubiregi2-Release" -configuration “Release" CONFIGURATION_BUILD_DIR=“build"

    CONFIGURATION_TEMP_DIR=“build/temp" CODE_SIGN_IDENTITY="iPhone Distribution: Ubiregi Inc. (A1234567XZ)” archive -archivePath "build/Ubiregi2.xcarchive" #VJMEYDBSDIJWF
  13. None
  14. xcodebuild -exportArchive -exportFormat “IPA" -archivePath “build/Ubiregi2.xcarchive" -exportPath “build/Ubiregi2.ipa" -exportProvisioningProfile "Ubiregi

    Ad Hoc" &YQPSUJQBGSPNYDBSDIJWF
  15. None
  16. None
  17. def zip_dsyms sh "(cd #{BUILD_DIR}; zip -ryq #{APP_NAME}.app.dSYM.zip #{APP_NAME}.app.dSYM)" sh

    "mv #{DSYM_FILE} #{BUILD_DIR}/#{APP_NAME}.xcarchive/dSYMs/#{APP_NAME}.app.dSYM" ! sh "(cd #{BUILD_DIR}; zip -ryq #{APP_NAME}.xcarchive.zip #{APP_NAME}.xcarchive)" end ;JQE4:. %FCVH4ZNCPM'JMF
  18. None
  19. task distribute: ["distribute:release"] ! namespace :distribute do task :release =>

    ["archive:release"] do distribute end ! task :adhoc => ["version:set_build_version", "archive:adhoc"] do distribute end end 6QMPBEFBDIpMFT
  20. def crittercism options = { dsym: "@#{DSYM_ZIP_FILE}", key: API_KEY, }

    upload_form("https://api.crittercism.com/api_beta/dsym/#{APP_ID}", options) end ! def testflight options = { file: "@#{IPA_FILE}", api_token: API_TOKEN, team_token: TEAM_TOKEN, notify: true, replace: true, distribution_lists: pull_request? ? "Dev" : "Internal", notes: release_notes, } upload_form("http://testflightapp.com/api/builds.json", options) end
  21. None
  22. None
  23. J5VOFTDPOOFDUIBTOP"1* UPTVCNJUJ04"QQT

  24. None
  25. None
  26. None
  27. None
  28. 4VCNJU

  29. 5SJHHFSJOHCZ1VMM3FRVFTU

  30. 5SJHHFSJOHCZ1VMM3FRVFTU

  31. 5SJHHFSJOHCZ1VMM3FRVFTU