ãã®èšäºã§ã¯ãmacOSã䜿çšãããã€ãã£ããã«ãã§Gitlabãä»ããŠAndroidããã³iOSã§Unityãããžã§ã¯ãããã«ãããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ç§ã¯å°ããªã²ãŒã éçºäŒç€Ÿã§åããŠããŸããã次ã®åé¡ãåå ã§ã¢ã»ã³ããªãèªååããã¿ã¹ã¯ãçŸããŸããã
- 5ã€ã®åæ£ããŒã ã¯ãäžçäžã®ã©ãããã§ããããžã§ã¯ããåéããå¿ èŠããããŸã
- ç°ãªããŠãããããŒãžã§ã³ããµããŒãããå¿ èŠããããŸã
- ã¢ã»ã³ãã©ãŒã¯åããŒã ããå°ãªããšãé±ã«5ã€ã®ã¢ã»ã³ããªãæäŸããå¿ èŠããããŸã
- 蚌ææžã¯éçºè ã§ã¯ãªãäžå€®ã«ä¿åããå¿ èŠããããŸã
- åéããããã«ãã¯ãäžçäžã®ã©ãããã§ãåç §ã«ããã¢ã¯ã»ã¹å¯èœã§ãªããã°ãªããŸãã
- ãããžã§ã¯ãã§å¿ èŠãªã©ã€ãã©ãªã®ååšã確èªããå¿ èŠããããŸãïŒåºåSDKãšã³ãŒããããŒã«ãªãŒãŒã·ã§ã³ãä¿åïŒ
- ã³ãã³ãã®ã¢ã»ã³ããªæ§æã¯1ãæã§è¡ãå¿ èŠããããŸã
ãããã®åé¡ã解決ããããã«ãUnity Cloud BuildãTeamCityãJenkinsãGitlab CIãBitbucket Pipelinesãªã©ã®æ¢è£œã®ãœãªã¥ãŒã·ã§ã³ãæ¢ã«äœæãããŠããŸãã
æåã®ãã®ã¯ãUnityãããžã§ã¯ãã®ã¢ã»ã³ããªçšã«æºåãããŠããŸããã蚌ææžã䜿çšããäœæ¥ã®èªååã¯èš±å¯ãããŠãããããããžã§ã¯ãããšã«æåã§å
¥åããå¿
èŠããããŸãã TeamCityãšJenkinsã§ã¯ã管çé åã§ãããžã§ã¯ããèšå®ãïŒããã«ããéçºè
ã®æ§æãå°ãè€éã«ãªããŸãïŒãå¥ã®ãµãŒããŒã«è¿œå ã®ãœãããŠã§ã¢ãã€ã³ã¹ããŒã«ãããã®ãµããŒããè¡ãå¿
èŠããããŸãã ãã®çµæãGitlabãšBitbucketã®2ã€ã®ãªãã·ã§ã³ãå®è£
ããã®ãæãç°¡åã§æéã§ããã
åé¡ã解決ããæç¹ã§ã¯ãBitbucket Pipelinesã¯ãŸã çºè¡šãããŠããªãã£ããããGitlabã䜿çšããããšã決å®ãããŸããã
ãã®ã¢ãããŒããå®è£ ããããã«ã次ã®æé ãå®è¡ãããŸããã
- ãããžã§ã¯ãã®ã»ããã¢ãã
- ã©ã³ããŒèšå®
- ãã«ãã¹ã¯ãªããã®äœæ
1.ãããžã§ã¯ãã®ã»ããã¢ãã
ã³ã¬ã¯ã¿ãŒã§åéããããããžã§ã¯ãã¯ãGitlabã«ä¿åãããŸãã ãµãŒãã¹ã®ç¡æçã¯ããªããžããªèªäœãšãã®æ°ãå¶éããŸããã
åãããžã§ã¯ãã«ã¯ããããŒã§å®è¡ãããã©ã³ããŒïŒgitlabãµãŒããŒããã³ãã³ããå®è¡ãããµãŒãã¹ïŒãå«ãŸããŠããŸãã
ã³ã¬ã¯ã¿ãŒã®æ§æã¯ã.gitlab-ci.ymlãã¡ã€ã«ãšããŠãããžã§ã¯ãã®ã«ãŒãã«ãããŸãã ã¢ããªã±ãŒã·ã§ã³IDãå¿
èŠãªçœ²åIDïŒAndroidã®ããŒã¹ãã¢ãšiOSã®ã¢ã«ãŠã³ãåïŒãå¿
èŠãªUnityããŒãžã§ã³ããã©ã³ããèµ·åã¢ãŒãïŒæåãŸãã¯èªåãããã³ã¢ã»ã³ããªãéå§ããã³ãã³ãïŒå¿
èŠã«å¿ããŠãgitlabã¯ããå€ãã®ãã©ã¡ãŒã¿ãŒã ããã¥ã¡ã³ãããµããŒãïŒ ã«ã€ããŠèª¬æããŸã ã
variables: BUNDLE: com.banana4apps.evolution SIGNING: banana4apps UNITY_VERSION: 2017.1 build:android: script: - buildAndroid.sh $BUNDLE $SIGNING $UNITY_VERSION only: - releaseAndroid when: manual build:ios: script: - buildIOS.sh $BUNDLE $SIGNING $UNITY_VERSION only: - releaseIOS when: manual
2.ã©ã³ããŒã®ã»ããã¢ãã
Gitlab CIã¯ãå
±æã©ã³ããŒãšç¬èªã®ã©ã³ããŒã§åäœããŸã ïŒ ããã¥ã¡ã³ã ïŒã ç¡æçã§ã¯ãå
±æã©ã³ããŒã®äœ¿çšæéã«å¶éããããŸãããç¬èªã®ã©ã³ããŒãç¡å¶éã«äœ¿çšã§ããŸãã å
±æã©ã³ããŒã¯Linuxäžã§å®è¡ããããããiOSã¢ããªã±ãŒã·ã§ã³ããããã§ã¢ã»ã³ãã«ããããšã¯ã§ããŸããïŒãã ããUnityã¯æåããŸããããã«é¢ããèšäºããããŸããïŒã ãã®ãããç§ã¯èªåã®ãããŒã§ã©ã³ããŒãäžããå¿
èŠããããŸããã äžèšã®äŸã§ã¯ãã©ã³ããŒã¯buildAndroid.shãŸãã¯buildIOS.shã¹ã¯ãªããïŒãã©ã³ãã«ãã£ãŠç°ãªãïŒãå®è¡ããŸããããã¯ãæºåæé ãUnityã®èµ·åããã«ãçµæã®éç¥ãèšè¿°ããŠããŸãã
ã©ã³ããŒã®èšå®ããã»ã¹ã¯ããã¥ã¡ã³ãã«gitlab-runner install
説æãããŠããã gitlab-runner install
ããã³gitlab-runner start
ãŸãã
ãã®åŸãå¿
èŠãªUnityããŒãžã§ã³ããããŒã«ã€ã³ã¹ããŒã«ãããŸãã
3.ãã«ãã¹ã¯ãªããã®äœæ
ãã©ãããã©ãŒã ããšã«ããã«ãããã»ã¹ã®éãã«ãããç¬èªã®ã¹ã¯ãªãããäœæããå¿ èŠããããŸããã ãã ããã¢ã«ãŽãªãºã ã¯åãã§ãã
- ãããžã§ã¯ãIDã®æ£ç¢ºæ§ãç®çã®çœ²åIDã®èšŒææžã®å¯çšæ§ã確èªããŸã
- SDKãJavaãžã®ãã¹ãå®çŸ©ãã
- ã¢ã»ã³ããªãéå§ããã¡ãœããã䜿çšããŠCïŒãããžã§ã¯ãã«ã¯ã©ã¹ãäœæããŸã
- Unityã®å¿ èŠãªããŒãžã§ã³ã®å¯çšæ§ã確èªããã¢ã»ã³ããªãå®è¡ããŸãã ããã§ãªãå Žåã¯ãããã©ã«ãããŒãžã§ã³ã§ãã«ãããŠã¿ãŠãã ãã
- apkãŸãã¯Xcodeãããžã§ã¯ãã®å¯çšæ§ã確èªããååšããªãå Žåã¯Slackã§ãšã©ãŒãéç¥ããŸã
- iOSã®å ŽåïŒXcodeãããžã§ã¯ãã®æ§ç¯
- ã¢ãŒãã£ãã¡ã¯ãïŒapkãipaïŒããµãŒããŒïŒAmazon S3ãªã©ïŒã«ã¢ããããŒãããŸã
- Slackã§ãã«ããæåããããšãéç¥ããã¢ãŒãã£ãã¡ã¯ããããŠã³ããŒãããããã®ãªã³ã¯ãéä¿¡ããŸã
Unityãããžã§ã¯ãããã«ãããç¹æ§ã¯ãUnityããããã¢ãŒãã§äœ¿çšãããšããããžã§ã¯ãã§äœ¿çšå¯èœãªã¯ã©ã¹ã®éçã¡ãœããã®ã¿ãå®è¡ã§ããããšã§ãã ãããã£ãŠãã¢ã»ã³ããªã¹ã¯ãªããã¯ãã¢ã»ã³ããªãéå§ããããã®ã¡ãœãããå«ãã¯ã©ã¹ããããžã§ã¯ãã«ãã¹ããŒãããŸãã
public class CustomBuild { static string outputProjectsFolder = Environment.GetEnvironmentVariable("OutputDirectory"); static string xcodeProjectsFolder = Environment.GetEnvironmentVariable("XcodeDirectory"); static void BuildAndroid() { BuildTarget target = BuildTarget.Android; EditorUserBuildSettings.SwitchActiveBuildTarget(target); PlayerSettings.applicationIdentifier = Environment.GetEnvironmentVariable("AppBundle"); PlayerSettings.Android.keystoreName = Environment.GetEnvironmentVariable("KeystoreName"); PlayerSettings.Android.keystorePass = Environment.GetEnvironmentVariable("KeystorePassword"); PlayerSettings.Android.keyaliasName = Environment.GetEnvironmentVariable("KeyAlias"); PlayerSettings.Android.keyaliasPass = Environment.GetEnvironmentVariable("KeyPassword"); BuildPipeline.BuildPlayer(GetScenes(), string.Format("{0}/{1}.apk" , outputProjectsFolder, PlayerSettings.applicationIdentifier), target, options); } static void BuildIOS() { BuildTarget target = BuildTarget.iOS; EditorUserBuildSettings.SwitchActiveBuildTarget(target); PlayerSettings.applicationIdentifier = Environment.GetEnvironmentVariable("AppBundle"); PlayerSettings.iOS.appleDeveloperTeamID = Environment.GetEnvironmentVariable("GymTeamId"); BuildPipeline.BuildPlayer(GetScenes(), xcodeProjectsFolder, target, options); } // static string[] GetScenes() { var projectScenes = EditorBuildSettings.scenes; List<string> scenesToBuild = new List<string>(); for (int i = 0; i < projectScenes.Length; i++) { if (projectScenes[i].enabled) { scenesToBuild.Add(projectScenes[i].path); } } return scenesToBuild.ToArray(); } }
Environment.GetEnvironmentVariableã¡ãœããã¯ãbashã¹ã¯ãªããã§ä»¥åã«æå®ãããç°å¢å€æ°ã®å€ãååŸããŸãã
Androidãã«ãã¹ã¯ãªããã®äŸ
GREEN='\033[0;32m' RED='\033[0;33m' NC='\033[0m' # No Color export COMMIT=$(git log -1 --oneline âno-merges) if [ "$1" = "" ]; then echo -e "${RED}You must provide application Id${NC}" exit 1 fi export ANDROID_HOME=/Library/Android export OutputDirectory=./ export AppBundle=$1 if [ "$2" = "account1" ]; then export KeystoreName="$CI_DATA_PATH/keystores/account1.keystore" export KeystorePassword="..." export KeyAlias="..." export KeyPassword="..." elif [ "$2" = "account2" ]; then export KeystoreName="$CI_DATA_PATH/keystores/account2.keystore" export KeystorePassword="..." export KeyAlias="..." export KeyPassword="..." else echo "${RED}No keystore config found for $2${NC}" exit 1 fi echo -e "${GREEN}BundleId: ${AppBundle}${NC}" echo -e "${GREEN}Signing: ${KeyAlias}${NC}" # mkdir -p $CI_PROJECT_DIR/Assets/Editor && cp $CI_DATA_PATH/CustomBuild.cs "$_" # Unity if [ "$3" = "5.5" ]; then /Applications/Unity5.5/Unity.app/Contents/MacOS/Unity -buildTarget android -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.Android -quit -logFile /dev/stdout -username "..." -password "..." elif [ "$3" = "2017.1" ]; then /Applications/Unity2017.1/Unity.app/Contents/MacOS/Unity -buildTarget android -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.Android -quit -logFile /dev/stdout -username "..." -password "..." else /Applications/Unity5.6.4/Unity.app/Contents/MacOS/Unity -buildTarget android -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.Android -quit -logFile /dev/stdout -username "..." -password "..." fi # , apk export APK="${CI_PROJECT_DIR}/${OutputDirectory}/${AppBundle}.${CI_BUILD_ID}.apk" echo "Testing apk exists: ${APK}..." if [ -f ${APK} ]; then echo -e "${GREEN}BUILD FOR ANDROID SUCCESS${NC}" # apk aws s3 cp ${APK} s3://ci-data/android/${AppBundle}.${CI_BUILD_ID}.apk --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers echo "<html><title>Download apk: ${AppBundle}</title><body><a href=\"https://ci-data.s3.amazonaws.com/android/${AppBundle}.${CI_BUILD_ID}.apk\">Install<br><br><strong>${AppBundle}</strong><br><small>${COMMIT}<br>(build ${CI_BUILD_ID} - android)</small></a></body></html>" >> ${CI_PROJECT_DIR}/download.html # html aws s3 cp ${CI_PROJECT_DIR}/download.html s3://ci-data/android/${AppBundle}.${CI_BUILD_ID}.html --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers # Slack ${CI_DATA_PATH}/notifySlack.sh android success "https://ci-data.s3.amazonaws.com/android/${AppBundle}.${CI_BUILD_ID}.html" exit 0 else echo -e "${RED}BUILD FOR ANDROID FAILED${NC}" ${CI_DATA_PATH}/notifySlack.sh android failure exit 1 fi
iOSçšã®ãµã³ãã«ãã«ãã¹ã¯ãªãã
ãããžã§ã¯ãã®ã¢ã»ã³ããªã¯ãUnityããã®Xcodeãããžã§ã¯ãã®åœ¢æãšXcodeãããžã§ã¯ãã®ã¢ã»ã³ããªãšãã2ã€ã®ã¹ãããã§å®è¡ãããŸãã éçºè
ã¯Xcodeãããžã§ã¯ãã«çŽæ¥åœ±é¿ãäžããããšã¯ã§ããŸãããããã¯å¶éããããããŸãããããžã§ã¯ãèšå®ãã¢ã»ã³ããªæ
å ±ãçŽæ¥å€æŽããããšã¯ã§ããŸããã
ãŸããiOSã®ãã«ãæ©èœã§ã¯ããã¹ãããã€ã¹ãã¢ããªã±ãŒã·ã§ã³ã®ããããžã§ãã³ã°ãããã¡ã€ã«ã«ç»é²ããå¿
èŠããããŸãã Xcodeãããžã§ã¯ãããã«ãããã«ã¯ããã«ãããåã«Appleã®éçºè
ã³ã³ãœãŒã«ã§èšŒææžãããããžã§ãã³ã°ãããã¡ã€ã«ãããã³ã¢ããªã±ãŒã·ã§ã³IDãäœæããå¿
èŠããããŸãã
Fastlaneã¯ããã®ããã»ã¹ãèªååããããã«äœ¿çšãããŸãã ãã®ããŒã«ã¯ã蚌ææžãšãããã¡ã€ã«ãäœæããã³åæãããã«ããšã¡ã¿æ
å ±ãiTunes Connectã«ã¢ããããŒãã§ããããã«ããŸãã
Xcodeã«ã¢ã¯ã»ã¹ããã«Unityãããžã§ã¯ããæ§ç¯ããå Žåã埮åŠãªéãããããŸãã
- Unityã§ã¯ããããžã§ã¯ãããã«ãããåã«ãéçºè ã®ã³ââã³ãœãŒã«ã«ããTeamIdãæå®ããå¿ èŠããããŸã-ããã¯PlayerSettings.iOS.appleDeveloperTeamIDãä»ããŠè¡ãããŸã
- åŸåŠçãããžã§ã¯ãã¹ã¯ãªããã§ã¯ãXcodeãããžã§ã¯ããååŠçããå¿
èŠããããŸããinfo.plistãæ§æããèšå®ããã«ãããŸã
ãªãªãŒã¹ãšã¢ãããã¯ãã«ãã«ã¯ãçµæã®åœ¢æãç°ãªãã¹ã¯ãªããããããŸãããªãªãŒã¹ã¯ãiTunes Connectã§ã¢ãŒã«ã€ããããŠã³ããŒãããIPAãã¢ãããã¯ããŠã³ããŒããããããã§ã¹ããšããŠã³ããŒãããŒãžãç¡ç·ã§äœæãããã¹ãŠã®é¢ä¿è ã«ãªã³ã¯ãéä¿¡ãããŸãã
GREEN='\033[0;32m' RED='\033[0;33m' NC='\033[0m' # No Color export COMMIT=$(git log -1 --oneline --no-merges) if [ "$1" = "" ]; then echo -e "${RED}You must provide application Id${NC}" exit 1 fi if [ "$2" = "account1" ]; then # fastlane export AccountName="account email" export AccountDesc="account description" export FastlanePassword="..." export GymExportTeamId="..." export FastlaneRepository="fastlane-keys.git" export ProduceTeamName="team name" else echo "${RED}No keystore config found for $2${NC}" exit 1 fi echo -e "${GREEN}BundleId: ${AppBundle}${NC}" echo -e "${GREEN}Account: ${AccountDesc} (${2})${NC}" # mkdir -p $CI_PROJECT_DIR/Assets/Editor && cp $CI_DATA_PATH/CustomBuild.cs "$_" # Unity if [ "$3" = "5.5" ]; then /Applications/Unity5.5/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." elif [ "$3" = "2017.1" ]; then /Applications/Unity2017.1/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." else /Applications/Unity5.6.4/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." fi # , Unity XCode XCODE_FILES="${CI_PROJECT_DIR}/${XcodeDirectory}" if [ -d ${XCODE_FILES} ]; then # Apple Developer Console export PRODUCE_APP_IDENTIFIER=${AppBundle} export PRODUCE_APP_NAME=${AppBundle} export PRODUCE_USERNAME=${AccountName} export PRODUCE_SKU=${AppBundle} # skip_itc itunes connect - adhoc fastlane produce --app_version "1.0" --language "English" --skip_itc # code signing keys and profiles cd "${CI_PROJECT_DIR}/${XcodeDirectory}" rm -f Matchfile echo "git_url \"${FastlaneRepository}\"" >> Matchfile echo "app_identifier [\"${AppBundle}\"]" >> Matchfile echo "username \"${AccountName}\"" >> Matchfile # , export MATCH_PASSWORD='...' # , # force_for_new_devices true , developer console fastlane match adhoc --force_for_new_devices true # Gymfile XCode project Ad-Hoc rm -f Gymfile echo "export_options(" >> Gymfile echo " manifest: {" >> Gymfile echo " appURL: \"https://ci-data.s3.amazonaws.com/ios/${AppBundle}.${CI_BUILD_ID}.ipa\"," >> Gymfile echo " displayImageURL: \"https://ci-data.s3.amazonaws.com/ios-icon.png\"," >> Gymfile echo " fullSizeImageURL: \"https://ci-data.s3.amazonaws.com/ios-icon-big.png\"" >> Gymfile echo " }," >> Gymfile echo ")" >> Gymfile fastlane gym --scheme "Unity-iPhone" --export_method ${GYM_EXPORT_METHOD} --xcargs "DEVELOPMENT_TEAM=\"${GYM_EXPORT_TEAM_ID}\" PROVISIONING_PROFILE_SPECIFIER=\"match AdHoc ${AppBundle}\" CODE_SIGN_IDENTITY=\"iPhone Distribution: ${AccountDesc}\"" -o "${CI_PROJECT_DIR}/" -n "${AppBundle}.${CI_BUILD_ID}.ipa" # S3 export IPA="${CI_PROJECT_DIR}/${AppBundle}.${CI_BUILD_ID}.ipa" ls -l "${CI_PROJECT_DIR}/${XcodeDirectory}/*.ipa" echo "Testing ipa exists: ${IPA}..." if [ -f ${IPA} ]; then echo -e "Begin uploading to S3..." aws s3 cp ${CI_PROJECT_DIR}/${AppBundle}.${CI_BUILD_ID}.ipa s3://ci-data/ios/${AppBundle}.${CI_BUILD_ID}.ipa --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers aws s3 cp ${CI_PROJECT_DIR}/manifest.plist s3://ci-data/ios/${AppBundle}.${CI_BUILD_ID}.plist --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers echo "<html><title>Download ipa: ${AppBundle}</title>" >> ${CI_PROJECT_DIR}/download.html echo "<body><a href=\"itms-services://?action=download-manifest&url=https://ci-data.s3.amazonaws.com/ios/${AppBundle}.${CI_BUILD_ID}.plist\">Install<br><br><strong>${AppBundle}</strong><br><small>${COMMIT}<br>(build ${CI_BUILD_ID} - iOS)</small></a></body></html>" >> ${CI_PROJECT_DIR}/download.html aws s3 cp ${CI_PROJECT_DIR}/download.html s3://ci-data/ios/${AppBundle}.${CI_BUILD_ID}.html --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers ${CI_DATA_PATH}/notifySlack.sh ios ad-hoc "https://ci-data.s3.amazonaws.com/ios/${AppBundle}.${CI_BUILD_ID}.html" echo -e "${GREEN}BUILD AD-HOC FOR IOS SUCCESS${NC}" exit 0 else echo -e "${RED}BUILD AD-HOC FOR IOS FAILED${NC}" ${CI_DATA_PATH}/notifySlack.sh ios failure exit 1 fi else echo -e "${RED}BUILD FOR IOS FAILED${NC}" ${CI_DATA_PATH}/notifySlack.sh ios failure exit 1 fi
GREEN='\033[0;32m' RED='\033[0;33m' NC='\033[0m' # No Color export COMMIT=$(git log -1 --oneline --no-merges) if [ "$1" = "" ]; then echo -e "${RED}You must provide application Id${NC}" exit 1 fi if [ "$2" = "account1" ]; then # fastlane export AccountName="account email" export AccountDesc="account description" export FastlanePassword="..." export GymExportTeamId="..." export FastlaneRepository="fastlane-keys.git" export ProduceTeamName="team name" else echo "${RED}No keystore config found for $2${NC}" exit 1 fi echo -e "${GREEN}BundleId: ${AppBundle}${NC}" echo -e "${GREEN}Account: ${AccountDesc} (${2})${NC}" # mkdir -p $CI_PROJECT_DIR/Assets/Editor && cp $CI_DATA_PATH/CustomBuild.cs "$_" # Unity if [ "$3" = "5.5" ]; then /Applications/Unity5.5/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." elif [ "$3" = "2017.1" ]; then /Applications/Unity2017.1/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." else /Applications/Unity5.6.4/Unity.app/Contents/MacOS/Unity -buildTarget ios -projectPath $CI_PROJECT_DIR -batchmode -executeMethod CustomBuild.IOS -quit -logFile /dev/stdout -username "..." -password "..." fi # , Unity XCode XCODE_FILES="${CI_PROJECT_DIR}/${XcodeDirectory}" if [ -d ${XCODE_FILES} ]; then # Apple Developer Console and Itunes Connect export PRODUCE_APP_IDENTIFIER=${AppBundle} export PRODUCE_APP_NAME=${AppBundle} export PRODUCE_USERNAME=${AccountName} export PRODUCE_SKU=${AppBundle} fastlane produce --app_version "1.0" --language "English" # code signing keys and profiles cd "${CI_PROJECT_DIR}/${XcodeDirectory}" rm -f Matchfile echo "git_url \"${FastlaneRepository}\"" >> Matchfile echo "app_identifier [\"${AppBundle}\"]" >> Matchfile echo "username \"${AccountName}\"" >> Matchfile # , export MATCH_PASSWORD='...' # fastlane match appstore # XCode fastlane gym --scheme "Unity-iPhone" --xcargs "DEVELOPMENT_TEAM=\"${GymExportTeamId}\" PROVISIONING_PROFILE_SPECIFIER=\"match AppStore ${AppBundle}\" CODE_SIGN_IDENTITY=\"iPhone Distribution: ${AccountDesc}\"" -o "${CI_PROJECT_DIR}/" -n "${AppBundle}.${CI_BUILD_ID}.ipa" # itunes connect export IPA="${CI_PROJECT_DIR}/${AppBundle}.${CI_BUILD_ID}.ipa" ls -l "${CI_PROJECT_DIR}/${XcodeDirectory}/*.ipa" echo "Testing ipa exists: ${IPA}..." if [ -f ${IPA} ]; then rm -f Deliverfile echo "app_identifier \"${AppBundle}\"" >> Deliverfile echo "username \"${AccountName}\"" >> Deliverfile echo "ipa \"${IPA}\"" >> Deliverfile echo "submit_for_review false" >> Deliverfile echo "force true" >> Deliverfile fastlane deliver echo -e "${GREEN}BUILD FOR IOS SUCCESS${NC}" exit 0 else echo -e "${RED}BUILD FOR IOS FAILED${NC}" ${CI_DATA_PATH}/notifySlack.sh ios failure exit 1 fi else echo -e "${RED}BUILD FOR IOS FAILED${NC}" ${CI_DATA_PATH}/notifySlack.sh ios failure exit 1 fi
ä»ã®äººããã®ã·ã¹ãã ã§ã©ã®ããã«åãã
- éçºè ã¯ããã³ãã¬ãŒããã¡ã€ã«.gitlab-ci.ymlããããžã§ã¯ãã«ãŒãã«è¿œå ããgitlab.comã®ãããžã§ã¯ãèšå®ã«ã©ã³ããŒãå«ããã³ãŒããç®çã®ãã©ã³ãã«ããã·ã¥ããŸãã
- ã²ãŒã ãã¶ã€ããŒãšãã¹ã¿ãŒã¯ãã¢ã»ã³ããªã®æåã«é¢ããéç¥ãšãSlackã§apkããã³ipaã¢ãŒã«ã€ããããŠã³ããŒãããããã®ãªã³ã¯ãåãåããŸãã
- ç§ã¯ãã«ãã远跡ãããã°ã確èªããéçºè ããã°ã«å¯ŸåŠããã®ãå©ããããšãã§ããŸãã ãã°ãšå®è¡äžã®ãã«ãã¯ãgitlabã§çŽæ¥ç¢ºèªã§ããŸãã ãã€ãã¹ã®-ä»ãã€ã³ã¿ãŒãã§ã€ã¹ã§ã¯ãç¹å®ã®ã©ã³ããŒã®ãã«ããã¥ãŒãèŠãããšãã§ããŸããã
ãã«ããã°ã衚瀺ããããã®ã€ã³ã¿ãŒãã§ã€ã¹ïŒ
çµæ
ãããã£ãŠãçµæã®ã·ã¹ãã ã¯äœ¿ããããããµãŒããŒåŽãããã§ãã¯ãšæ€èšŒãè¿œå ã§ããŸãïŒã³ãŒãã¹ã¿ã€ã«ããã¹ãïŒããããŒãžã£ãŒã¯Slackã®ã¢ã»ã³ããªãžã®ãªã³ã¯ã衚瀺ããiOSã®ã¢ã»ã³ããªã«åé¡ã¯ãããŸããã
ãã€ãã¹-ãã®ãµããŒãã¯ãUnityã®æ°ããããŒãžã§ã³ãè¿œå ããIDã«çœ²åããã±ã·ã®å¥åº·ã確ä¿ããããã«å¿ èŠã§ãã
çŸåšã2人ã®ã©ã³ããŒãåããŠããïŒçŽ2幎ïŒã4000ãè¶ ããã¢ã»ã³ããªãã·ã¹ãã ãééããŠããŸãã ãã«ãé床ã¯ãã©ã³ããŒã®ç¹æ§ãšãããžã§ã¯ãå ã®ã¢ã»ããã®æ°ã«äŸåããŸãããããã¯æ¯åã€ã³ããŒããããAndroidã§ã¯3ã30åãiOSã§ã¯10ã60åã§å€åããããã§ãã