[iOS] Github Workflow
In the fast-paced world of software development, efficiency and automation are key to staying ahead of the curve. As a self-employed developer, managing every aspect of my projects from build to deployment often felt like a juggling act. That’s when I discovered GitHub Workflows — an automation tool that promised to streamline my development pipeline and free up valuable time. In this article, I’ll share my personal journey integrating GitHub Workflows into my solo projects, including the setup process, the challenges I faced, and the remarkable improvements that followed. Join me as I reveal how automation transformed my workflow and made my development process more efficient than ever.
Actually all you need is right there in Github documentation page, but just wanna share my experience that take me almost 12 hours just for implementing or integrating it.
First you can’t just use default swift.yml that automatic created by Github. My final Capstone Project Rejected by reviewer because I activated this work flow. wk wk !!!
So I need to fix it to re submit my Capstone Project again and fixing some feature that I don’t I planned beause I use my ongoing Design System Project.
Thats wk wk again !!!!!! :(
Oke let me continue my story, to implement Github Workflow like other CI/CD, we need upload or set our Code Signing Identity and Provisioning Profile to make it work.
Then we copy and set to correct folder, like Codemagic we need to set Keychain again to import Code Signing Identity to machine (I need to learn this after this).
Step is more or less like this
- Import Certificate
- Create temporary Keychain
- Import Certificate to Keychain
- Apply Provisoning Profile
You can check the sample here.
So what is the problem if as simple as that ?
Here the problem, my Certificate just for build iPhone device (Simulator or Registered Device) but when giving command to xcodebuild I dont give specific value
-destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=18'
You can see, I got warning but I didn’t notice that warning. Warning said if there is no destination that doesn’t match with my description so machine will use first in the list, that mean :
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:0000FE00-E0FF59E53C7E2ABF }
Because mu provisioning profile not for platform:macOS arch:arm64 my command will be giving me issue.
I check and verify all, like if there a Certificate or Provisioning Profile use this command
- name: Verify Code Signing
env:
BUNDLE_ID: ${{ secrets.BUNDLE_ID }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
ls $PP_PATH
# Check if the certificate file exists
if [ ! -f "$CERTIFICATE_PATH" ]; then
echo "Certificate file not found at $CERTIFICATE_PATH"
exit 1
fi
# List available code signing identities
security find-identity -p codesigning -v
# Check if provisioning profile is present
if [ -f ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision ]; then
echo "Provisioning profile is present"
else
echo "Provisioning profile is missing"
exit 1
fi
# Decode the provisioning profile
security cms -D -i "$PP_PATH" > decoded_provisioning_profile.plist
# Check if the bundle ID is included in the provisioning profile
BUNDLE_IDS=$(plutil -extract Entitlements.application-identifier raw decoded_provisioning_profile.plist)
if [[ "$BUNDLE_IDS" == *"$BUNDLE_ID"* ]]; then
echo "Bundle ID $BUNDLE_ID is included in the provisioning profile"
else
echo "Bundle ID $BUNDLE_ID is NOT included in the provisioning profile"
exit 1
fi
And all command giving me information that all my setup is correct.
Fucckkkkkkkkk !!!!
Oke so I Fix it just like this, you know what is the different ? just 18 with 18.0
-destination 'platform=iOS Simulator,name=iPhone 14 Pro Max,OS=18.0'
Oke that is my Experience I hope you can learn from me !!
You can check my implementation here