Skip to content

Instantly share code, notes, and snippets.

@chrisleversuch
Created December 6, 2018 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisleversuch/b45b71cd7c9797ddc8abfbbe8b9b3ae2 to your computer and use it in GitHub Desktop.
Save chrisleversuch/b45b71cd7c9797ddc8abfbbe8b9b3ae2 to your computer and use it in GitHub Desktop.
Creating signed iOS builds using CircleCI
jobs:
dist_qa:
macos:
xcode: "10.1.0"
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- checkout
- run:
name: Get last build SHA1
command: |
LAST_BUILD=$(curl https://api.keyvalue.xyz/c2f7f594/ziffit-ios-last-build)
echo "export LAST_BUILD=$LAST_BUILD" >> $BASH_ENV
- run:
name: Save current SHA1
command: curl -X POST -IL https://api.keyvalue.xyz/c2f7f594/ziffit-ios-last-build/$CIRCLE_SHA1
- run:
name: Stop job if not required
command: |
if [ "$LAST_BUILD" != '' ] && [ $LAST_BUILD == $CIRCLE_SHA1 ]; then
echo "No deployment necessary"
circleci step halt
fi
- run: bundle install --path .bundle
- add_ssh_keys:
fingerprints:
- "6a:ea:9d:6c:8a:77:5f:56:16:69:36:f6:30:71:3e:00"
- run:
name: Fastlane Bump Build Number
command: bundle exec fastlane incrementBuild
- run: git clone git@github.com:brightec/ios-certificates.git
- run:
name: Install Profiles
command: |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp ios-certificates/ziffit/*.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles
- run:
name: Fastlane GB
command: bundle exec fastlane adhoc scheme:"Ziffit Staging GB"
- run:
name: Fastlane IE
command: bundle exec fastlane adhoc scheme:"Ziffit Staging IE"
- store_artifacts:
path: output
- store_test_results:
path: output/scan
- run:
name: Save current SHA1
command: |
CURRENT_SHA=$(git rev-parse HEAD)
curl -X POST -IL https://api.keyvalue.xyz/c2f7f594/ziffit-ios-last-build/$CURRENT_SHA
workflows:
version: 2
nightly:
triggers:
- schedule:
cron: "0 18 * * 1-5"
filters:
branches:
only:
- master
jobs:
- dist_qa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment