Skip to content

Commit

Permalink
Remove codesigning from ios circleci workflows (pytorch#85630)
Browse files Browse the repository at this point in the history
This PR is a follow up to pytorch#85597 which removes codesigning from our github action workflows. This is a synonymous change to our circleci workflows. Since we only run TestApp on simulator we don't need to have this codesigning logic. (And more pressingly, these dev cert is expiring at the end of the month and we don't have a replacement)
Pull Request resolved: pytorch#85630
Approved by: https://github.com/atalman, https://github.com/malfet
  • Loading branch information
jmdetloff authored and pytorchmergebot committed Sep 29, 2022
1 parent a9183c0 commit 0686800
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 93 deletions.
24 changes: 2 additions & 22 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 5 additions & 16 deletions .circleci/scripts/binary_ios_test.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
#!/bin/bash
set -ex -o pipefail

if ! [ "$IOS_PLATFORM" == "SIMULATOR" ]; then
exit 0
fi

echo ""
echo "DIR: $(pwd)"
PROJ_ROOT=/Users/distiller/project
cd ${PROJ_ROOT}/ios/TestApp
# install fastlane
sudo gem install bundler && bundle install
# install certificates
echo "${IOS_CERT_KEY_2022}" >> cert.txt
base64 --decode cert.txt -o Certificates.p12
rm cert.txt
bundle exec fastlane install_root_cert
bundle exec fastlane install_dev_cert
# install the provisioning profile
PROFILE=PyTorch_CI_2022.mobileprovision
PROVISIONING_PROFILES=~/Library/MobileDevice/Provisioning\ Profiles
mkdir -pv "${PROVISIONING_PROFILES}"
cd "${PROVISIONING_PROFILES}"
echo "${IOS_SIGN_KEY_2022}" >> cert.txt
base64 --decode cert.txt -o ${PROFILE}
rm cert.txt
# run the ruby build script
if ! [ -x "$(command -v xcodebuild)" ]; then
echo 'Error: xcodebuild is not installed.'
exit 1
fi
PROFILE=PyTorch_CI_2022
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM} -c ${PROFILE} -t ${IOS_DEV_TEAM_ID}
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM}
24 changes: 2 additions & 22 deletions .circleci/verbatim-sources/job-specs/job-specs-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -546,28 +546,14 @@
retry checkout
- run_brew_for_ios_build
- run:
name: Run Fastlane
name: Setup Fastlane
no_output_timeout: "1h"
command: |
set -e
PROJ_ROOT=/Users/distiller/project
cd ${PROJ_ROOT}/ios/TestApp
# install fastlane
sudo gem install bundler && bundle install
# install certificates
echo ${IOS_CERT_KEY_2022} >> cert.txt
base64 --decode cert.txt -o Certificates.p12
rm cert.txt
bundle exec fastlane install_root_cert
bundle exec fastlane install_dev_cert
# install the provisioning profile
PROFILE=PyTorch_CI_2022.mobileprovision
PROVISIONING_PROFILES=~/Library/MobileDevice/Provisioning\ Profiles
mkdir -pv "${PROVISIONING_PROFILES}"
cd "${PROVISIONING_PROFILES}"
echo ${IOS_SIGN_KEY_2022} >> cert.txt
base64 --decode cert.txt -o ${PROFILE}
rm cert.txt
- run:
name: Build
no_output_timeout: "1h"
Expand Down Expand Up @@ -625,18 +611,12 @@
command: |
set -e
PROJ_ROOT=/Users/distiller/project
PROFILE=PyTorch_CI_2022
# run the ruby build script
if ! [ -x "$(command -v xcodebuild)" ]; then
echo 'Error: xcodebuild is not installed.'
exit 1
fi
echo ${IOS_DEV_TEAM_ID}
if [ ${IOS_PLATFORM} != "SIMULATOR" ]; then
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM} -c ${PROFILE} -t ${IOS_DEV_TEAM_ID}
else
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM}
fi
ruby ${PROJ_ROOT}/scripts/xcode_build.rb -i ${PROJ_ROOT}/build_ios/install -x ${PROJ_ROOT}/ios/TestApp/TestApp.xcodeproj -p ${IOS_PLATFORM}
if ! [ "$?" -eq "0" ]; then
echo 'xcodebuild failed!'
exit 1
Expand Down
Binary file removed ios/TestApp/AppleWWDRCAG3.cer
Binary file not shown.
16 changes: 0 additions & 16 deletions ios/TestApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@ platform :ios do
before_all do
setup_ci(provider: "circleci", timeout: 0)
end
lane :install_root_cert do
import_certificate(
certificate_path: "AppleWWDRCAG3.cer",
keychain_path: "/Users/distiller/Library/Keychains/fastlane_tmp_keychain-db",
keychain_password: ""
)
end
lane :install_dev_cert do
puts "Installing Certificates.p12"
import_certificate(
keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
certificate_path: 'Certificates.p12',
certificate_password: ENV["IOS_CERT_SECRET"] || "default"
)
end
end
18 changes: 1 addition & 17 deletions scripts/xcode_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
opts.on('-p', '--platform ', 'platform for the current build, OS or SIMULATOR') { |value|
options[:platform] = value
}
opts.on('-c', '--provisioning_profile ', 'provisioning profile for code signing') { |value|
options[:profile] = value
}
opts.on('-t', '--team_id ', 'development team ID') { |value|
options[:team_id] = value
}
end.parse!
puts options.inspect

Expand All @@ -42,11 +36,6 @@
config.build_settings['LIBRARY_SEARCH_PATHS'] = libraries_search_path
config.build_settings['OTHER_LDFLAGS'] = other_linker_flags
config.build_settings['ENABLE_BITCODE'] = 'No'
dev_team_id = options[:team_id]
if not dev_team_id and options[:platform] == 'OS'
raise "Please sepecify a valid development team id for code signing"
end
config.build_settings['DEVELOPMENT_TEAM'] = dev_team_id
end

# link static libraries
Expand Down Expand Up @@ -84,10 +73,5 @@
raise "unsupported platform #{options[:platform]}"
end

profile = options[:profile]
if not profile and options[:platform] == 'OS'
raise "no provisioning profile found!"
end

# run xcodebuild
exec "xcodebuild clean build -project #{xcodeproj_path} -target #{target.name} -sdk #{sdk} -configuration Release PROVISIONING_PROFILE_SPECIFIER=#{profile} -arch #{arch}"
exec "xcodebuild clean build -project #{xcodeproj_path} -target #{target.name} -sdk #{sdk} -configuration Release -arch #{arch}"

0 comments on commit 0686800

Please sign in to comment.