Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI to work with GitHub Market Actions #214

Merged
82 changes: 82 additions & 0 deletions .github/workflows/GenerateIPA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Generate IPA

on:
workflow_dispatch:

jobs:
SwiftLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]

build:
name: Build and Test default scheme using iPhone simulator
runs-on: macos-13

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install and run 'bundle install'
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
# runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- name: Install npm
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Amplify
run: npm install -g @aws-amplify/cli
- name: Setup Amplify
id: setupAmplify
run: bash ./update_amplify.sh -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY -i $APP_ID -e $AMPLIFY_DEV_ENV -t $FACEBOOK_APP_ID -r $FACEBOOK_APP_SECRET
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
APP_ID: ${{ secrets.APP_ID }}
AMPLIFY_DEV_ENV: ${{ secrets.AMPLIFY_DEV_ENV }}
FACEBOOK_APP_ID: ${{ secrets.FACEBOOK_APP_ID }}
FACEBOOK_APP_SECRET: ${{ secrets.FACEBOOK_APP_SECRET }}
- name: Recover From Setup Amplfy Error
if: steps.setupAmplify.outcome != 'success'
run: bash ./recover_from_error.sh
- name: Setup .mapbox file with MAPBOX_DOWNLOAD_TOKEN
run: echo $MAPBOX_DOWNLOAD_TOKEN >> ~/.mapbox
env:
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
- name: Setup .netrc with MAPBOX_DOWNLOAD_TOKEN
run: |
echo 'machine api.mapbox.com' >> ~/.netrc
echo 'login mapbox' >> ~/.netrc
echo "password $MAPBOX_DOWNLOAD_TOKEN" >> ~/.netrc
chmod 0600 ~/.netrc
env:
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
- name: Install Swiftgen
run: brew install swiftgen
- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1'
- name: Build and export IPA
uses: yukiarrr/[email protected]
with:
project-path: animeal.xcodeproj
scheme: "animeal"
export-method: "development"
p12-base64: ${{ secrets.APPLE_DISTRIBUTION_CERTIFICATE }}
mobileprovision-base64: ${{ secrets.APPLE_DISTRIBUTION_PROVISIONING_PROFILE }}
certificate-password: ${{ secrets.UNLOCK_CERTIFICATE }}
code-signing-identity: "Apple Development: Pran Kishore (CM95PV92ZY)"
export-options: "ExportOptions.plist"
team-id: "2JSLPH439W"
configuration: "Debug"
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: output # Name of the artifact (optional)
path: '**/*.ipa' # Wildcard pattern to match output.ipa
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Unit Test

on:
pull_request:
Expand Down Expand Up @@ -60,8 +60,8 @@ jobs:
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
- name: Install Swiftgen
run: brew install swiftgen
- name: Install xcbeautify
run: brew install xcbeautify
- name: Check Amplify Version
run: amplify --version
- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
27 changes: 27 additions & 0 deletions ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>manageAppVersionAndBuildNumber</key>
<false/>
<key>method</key>
<string>development</string>
<key>provisioningProfiles</key>
<dict>
<key>com.epmedu.animealMobile</key>
<string>0563f355-19be-4a51-8405-18b2c166161f</string>
</dict>
<key>signingCertificate</key>
<string>Apple Development: Pran Kishore (CM95PV92ZY)</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>2JSLPH439W</string>
<key>uploadSymbols</key>
<true/>
<key>compileBitcode</key>
<false/>
</dict>
</plist>
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ https://colors.artyclick.com/color-name-finder/
Note:
1. for API keys and other secret please connect with one of our group members.
2. for first time on boarding guys in case the `update_amplify.sh` script failes. Please run the `recover_from_error.sh`

## Generate the string file

We needed to convert the certificate and provisioning profile to base 64 string format so that it can be used in the github actions secrets. Hence we used the following commands to convert the files to base 64 format.

openssl base64 -in dev-certificates.p12 -A | tr -d '\n' > dev-certificates_base64.txt
openssl base64 -in Animeal_Development_latest.mobileprovision -A | tr -d '\n' > Animeal_Development_latest_base64.txt
24 changes: 14 additions & 10 deletions animeal.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,7 @@
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animealMobile;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = "Animeal Development";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Animeal Development";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -3149,7 +3149,7 @@
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animealMobile;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Epam Animeal Prod App Store Distribution";
PROVISIONING_PROFILE_SPECIFIER = "Animeal App Store Distribution";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Animeal App Store Distribution";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -3163,9 +3163,9 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 2GBFVLY769;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -3176,6 +3176,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animealTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -3190,9 +3191,9 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 2GBFVLY769;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -3203,6 +3204,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animealTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -3215,9 +3217,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 53APD5F9YQ;
DEVELOPMENT_TEAM = 2JSLPH439W;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = animealUI/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand All @@ -3234,6 +3236,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animeal.ui;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -3245,9 +3248,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 53APD5F9YQ;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = animealUI/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand All @@ -3264,6 +3267,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.epmedu.animeal.ui;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
Loading