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

Debug App Store workflows #1248

Merged
merged 22 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/appstore-testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
continue-on-error: false
env:
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# Disable Turbo to see if that fixes the build - possible cache issue
# env:
# TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still necessary?

steps:
- uses: actions/checkout@v4
- name: Cache node modules
Expand Down Expand Up @@ -61,8 +62,9 @@ jobs:
fi

- name: Install jq
run: sudo apt-get install -y jq

run: |
brew update
brew install jq
- name: Declare some variables
shell: bash
run: |
Expand All @@ -71,7 +73,7 @@ jobs:
- name: Create version string
shell: bash
run: |
echo "version_string=v${{env.app_version}}-android-#${{env.sha_short}}" >> "$GITHUB_ENV"
echo "version_string=v${{env.app_version}}-ios-#${{env.sha_short}}" >> "$GITHUB_ENV"

- name: Set up ruby env
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -122,7 +124,7 @@ jobs:
uses: maierj/fastlane-action@v2.3.0
with:
lane: closed_beta_testflight
subdirectory: 'ios/App'
subdirectory: 'app/ios/App'
bundle-install-path: '$HOME/vendor/bundle'
verbose: false
env:
Expand Down
20 changes: 20 additions & 0 deletions app/bin/prebuildConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@ if test -f icons/icon-48.webp; then
mkdir -p ./public/assets
mv icons ./public/assets/icons
fi


## IOS specific configuration

# Setting the IOS build version
# https://pgu.dev/2020/12/16/ios-build-versioning.html

#version=$(grep '"version":' $PROJECT_DIR/package.json | cut -d: -f 2 | sed -e 's/[", ]//g')
# since we previously published 1.0.0 on app store we need a higher version
# number, set that here until we get the main version above this
version=1.0.4
buildNumber=$(date -u "+%Y%m%d%H%M")

if test -f /usr/libexec/PlistBuddy; then
echo "\nIOS: Configuring Info.plist settings"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" ./ios/App/App/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" ./ios/App/App/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLSchemes:0 $VITE_APP_ID" ./ios/App/App/Info.plist
/usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLName $VITE_APP_ID" ./ios/App/App/Info.plist
fi
25 changes: 2 additions & 23 deletions app/ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
isa = PBXAggregateTarget;
buildConfigurationList = D364126F278CFCD50019D84B /* Build configuration list for PBXAggregateTarget "Version" */;
buildPhases = (
D3641270278CFCD90019D84B /* ShellScript */,
);
dependencies = (
);
Expand Down Expand Up @@ -236,26 +235,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
D3641270278CFCD90019D84B /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(SRCROOT)/Scripts/get_build_number.sh",
"$(SRCROOT)/App/Info.plist",
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT\"/Scripts/get_build_number.sh\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -428,7 +407,7 @@
ENABLE_USER_SCRIPT_SANDBOXING = NO;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_PREFIX_HEADER = Plist/Prefix;
INFOPLIST_PREPROCESS = YES;
INFOPLIST_PREPROCESS = NO;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -462,7 +441,7 @@
ENABLE_USER_SCRIPT_SANDBOXING = NO;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_PREFIX_HEADER = Plist/Prefix;
INFOPLIST_PREPROCESS = YES;
INFOPLIST_PREPROCESS = NO;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
8 changes: 4 additions & 4 deletions app/ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<string>1.0.4</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>au.edu.faims.fieldmark</string>
<key>CFBundleURLSchemes</key>
<array>
<string>org.fedarch.faims3</string>
<string>au.edu.faims.fieldmark</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>202409110011</string>
<string>202412012317</string>
Comment on lines +20 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so these will need to be env variables or some other build replacement later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they get changed by the prebuildConfig.sh script.

<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
7 changes: 7 additions & 0 deletions app/ios/App/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
33 changes: 0 additions & 33 deletions app/ios/App/Scripts/get_build_number.sh

This file was deleted.

46 changes: 3 additions & 43 deletions app/ios/App/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,48 +34,7 @@ def ensure_temp_keychain(name, password)
end

platform :ios do
lane :test_ipa do
keychain_name = TEMP_KEYCHAIN_USER
keychain_password = TEMP_KEYCHAIN_PASSWORD
ensure_temp_keychain(keychain_name, keychain_password)

api_key = app_store_connect_api_key(
key_id: APPLE_KEY_ID,
issuer_id: APPLE_ISSUER_ID,
key_content: APPLE_KEY_CONTENT,
duration: 1200,
in_house: false
)

#increment_build_number(xcodeproj: "App.xcodeproj")
#handled by script and xcode in build phases, I hope.

cocoapods(
clean_install: true
)

match(
type: 'development',
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]),
readonly: false,
keychain_name: keychain_name,
keychain_password: keychain_password,
api_key: api_key
)

gym(
configuration: "Debug",
workspace: "App.xcworkspace",
scheme: "App",
export_method: "development",
export_options: {
provisioningProfiles: {
DEVELOPER_APP_ID => "match Development #{DEVELOPER_APP_IDENTIFIER}"
}
}
)
end

lane :closed_beta_browserstack do
keychain_name = TEMP_KEYCHAIN_USER
keychain_password = TEMP_KEYCHAIN_PASSWORD
Expand Down Expand Up @@ -124,6 +83,8 @@ platform :ios do
custom_id: "ios-github-actions-fastlane"
)
end


lane :closed_beta_testflight do
keychain_name = TEMP_KEYCHAIN_USER
keychain_password = TEMP_KEYCHAIN_PASSWORD
Expand Down Expand Up @@ -171,7 +132,6 @@ platform :ios do
merge_commit_filtering: "exclude_merges"
)


pilot(
apple_id: "#{DEVELOPER_APP_ID}",
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
Expand Down
Loading