diff --git a/.github/workflows/feature_test.yml b/.github/workflows/feature_test.yml index 202eaa789..5e2559ab0 100644 --- a/.github/workflows/feature_test.yml +++ b/.github/workflows/feature_test.yml @@ -98,3 +98,14 @@ jobs: GIT_REF_NAME: ${{ github.ref_name }} GIT_REF_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }} GITHUB_REF: ${{ github.ref }} + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: rabbymobile-${{ steps.actionvars.outputs.flatten_refname }}-${{ steps.actionvars.outputs.trigger_date }} + path: | + ./apps/mobile/android/app/build/outputs/apk/release/app-release.apk + ./apps/mobile/ios/Package/adhoc/*.ipa + ./apps/mobile/ios/Package/adhoc/manifest.plist + ./apps/mobile/ios/Package/adhoc/*.zip + retention-days: 7 diff --git a/.github/workflows/ios_release.yml b/.github/workflows/ios_release.yml index 817b9eb55..187172799 100644 --- a/.github/workflows/ios_release.yml +++ b/.github/workflows/ios_release.yml @@ -15,7 +15,7 @@ on: SENTRY_DISABLE_AUTO_UPLOAD: required: true type: boolean - default: true + default: false workflow_call: secrets: KEYCHAIN_PASS: @@ -76,9 +76,7 @@ jobs: # security unlock-keychain -p ${{ secrets.KEYCHAIN_PASS }} ~/Library/Keychains/login.keychain-db security unlock-keychain -p ${{ secrets.KEYCHAIN_PASS }} login.keychain - cd ios && bundle install && bundle exec pod install; - cd ../; - ./scripts/deploy-ios-adhoc.sh + ./scripts/deploy-ios-appstore.sh env: KEYCHAIN_PASS: ${{ secrets.KEYCHAIN_PASS }} @@ -89,8 +87,10 @@ jobs: REALLY_UPLOAD: ${{ inputs.REALLY_UPLOAD }} SENTRY_DISABLE_AUTO_UPLOAD: ${{ inputs.SENTRY_DISABLE_AUTO_UPLOAD }} CONFIGURATION: release - TYPE: adhoc + TYPE: appstore BUILD_ENV: release + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: {{ secrets.RABBY_MOBILE_APPLE_TRANSPORT_PASSWORD }} + RABBY_MOBILE_PILOT_USERNAME: {{ secrets.RABBY_MOBILE_PILOT_USERNAME }} LARK_CHAT_URL: ${{ secrets.LARK_CHAT_URL }} LARK_CHAT_SECRET: ${{ secrets.LARK_CHAT_SECRET }} RABBY_ROBOT_LARK_APP_ID: ${{ secrets.RABBY_ROBOT_LARK_APP_ID }} @@ -109,7 +109,6 @@ jobs: with: name: rabbymobile-${{ steps.actionvars.outputs.flatten_refname }}-${{ steps.actionvars.outputs.trigger_date }} path: | - ./apps/mobile/ios/Package/*.ipa - ./apps/mobile/ios/Package/manifest.plist - ./apps/mobile/ios/Package/*.zip + ./apps/mobile/ios/Package/appstore/*.ipa + ./apps/mobile/ios/Package/appstore/*.zip retention-days: 90 diff --git a/apps/mobile/fastlane/Fastfile b/apps/mobile/fastlane/Fastfile index b2077393f..8bf05dd88 100644 --- a/apps/mobile/fastlane/Fastfile +++ b/apps/mobile/fastlane/Fastfile @@ -31,8 +31,8 @@ platform :ios do scheme: 'RabbyMobile', workspace: './ios/RabbyMobile.xcworkspace', configuration: 'Release', - output_directory: "./ios/Package/latest", - build_path: "./ios/Package/latest", + output_directory: "./ios/Package/adhoc", + build_path: "./ios/Package/adhoc", destination: "generic/platform=iOS", clean: true, ## if you wanna output log to stdout, uncomment below 2 lines @@ -55,7 +55,7 @@ platform :ios do }) # # shell executeb on ./fastlane directory, add `sh "pwd"` below to check it - # sh "/usr/libexec/PlistBuddy -c \"Set:items:0:metadata:title Rabby Wallet\" ../ios/Package/latest/manifest.plist" + # sh "/usr/libexec/PlistBuddy -c \"Set:items:0:metadata:title Rabby Wallet\" ../ios/Package/adhoc/manifest.plist" end desc "Release for the iOS production" @@ -65,23 +65,30 @@ platform :ios do scheme: 'RabbyMobile', workspace: './ios/RabbyMobile.xcworkspace', configuration: 'Release', - output_directory: "./ios/Package", - build_path: "./ios/Package", + output_directory: "./ios/Package/appstore", + build_path: "./ios/Package/appstore", destination: "generic/platform=iOS", skip_profile_detection: true, clean: true, + ## if you wanna output log to stdout, uncomment below 2 lines + # xcodebuild_formatter: '', + # suppress_xcode_output: false, skip_package_pkg: true, export_method: "app-store", verbose: true, export_options: { method: "app-store", signingStyle: 'manual', + # provisioningProfiles: { + # "com.debank.rabby-mobile": "RabbyMobileAppStore" + # } }) pilot( apple_id: '6474381673', username: ENV["RABBY_MOBILE_PILOT_USERNAME"], - ipa: "./ios/Package/RabbyMobile.ipa", + ipa: "./ios/Package/appstore/RabbyMobile.ipa", skip_waiting_for_build_processing: true, + distribute_only: ENV["RABBY_MOBILE_PILOT_DISTRIBUTE_ONLY"] || false, ) end end diff --git a/apps/mobile/fastlane/README.md b/apps/mobile/fastlane/README.md index f2cd9e007..f3e8da2c6 100644 --- a/apps/mobile/fastlane/README.md +++ b/apps/mobile/fastlane/README.md @@ -1,4 +1,5 @@ -## fastlane documentation +fastlane documentation +---- # Installation @@ -22,15 +23,16 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do Release for the iOS adhoc -### ios release +### ios appstore ```sh -[bundle exec] fastlane ios release +[bundle exec] fastlane ios appstore ``` Release for the iOS production ---- +---- + ## Android @@ -42,15 +44,15 @@ Release for the iOS production Release for the Android alpha -### android release +### android appstore ```sh -[bundle exec] fastlane android release +[bundle exec] fastlane android appstore ``` Release for the Android production ---- +---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. diff --git a/apps/mobile/package.json b/apps/mobile/package.json index ed7f45513..b406375e5 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -1,6 +1,6 @@ { "name": "rabby-mobile", - "version": "0.1.8", + "version": "0.1.9", "private": true, "repository": { "type": "git", diff --git a/apps/mobile/scripts/deploy-ios-appstore.sh b/apps/mobile/scripts/deploy-ios-appstore.sh new file mode 100755 index 000000000..61363c9f8 --- /dev/null +++ b/apps/mobile/scripts/deploy-ios-appstore.sh @@ -0,0 +1,104 @@ +#!/bin/sh + +script_dir="$( cd "$( dirname "$0" )" && pwd )" +project_dir=$(dirname $script_dir) + +. $script_dir/fns.sh --source-only + +export buildchannel="appstore"; +export BUILD_TARGET_PLATFORM="ios"; +check_build_params; +check_s3_params; +checkout_s3_pub_deployment_params; + +# make plist file +cd $project_dir; +proj_version=$(node --eval="process.stdout.write(require('./package.json').version)"); +app_display_name=$(node --eval="process.stdout.write(require('./app.json').displayName)"); +cd $script_dir; + +ouput_dir=$project_dir/ios/Package/appstore +deployment_local_dir="$script_dir/deployments/ios-appstore" + +rm -rf $deployment_local_dir && mkdir -p $deployment_local_dir; + +mkdir -p "$script_dir/deployments/tmp" + +xcodebuild -project $project_dir/ios/RabbyMobile.xcodeproj -target "RabbyMobile" -showBuildSettings -json | plutil -convert xml1 - -o "$script_dir/deployments/tmp/RabbyMobileAppStore.plist" + +ios_version_name=$(/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" $project_dir/ios/RabbyMobile/Info.plist) +ios_version_code=$(/usr/libexec/PlistBuddy -c "Print:0:buildSettings:CURRENT_PROJECT_VERSION" $script_dir/deployments/tmp/RabbyMobileAppStore.plist) +cd $project_dir/ios; + +unix_replace_variables $script_dir/tpl/ios/version.json $deployment_local_dir/version.json \ + --var-DOWNLOAD_URL=$cdn_deployment_urlbase/ios/ \ + --var-APP_VER_CODE=$ios_version_code \ + --var-APP_VER="$proj_version" + +# ============ prepare changelogs :start ============== # +possible_changelogs=( + "$project_dir/src/changeLogs/$proj_version.md" +) + +for changelog in "${possible_changelogs[@]}"; do + if [ -f $changelog ]; then + echo "[deploy-ios-appstore] found changelog: $changelog" + cp $changelog $deployment_local_dir/ + break + fi +done +# ============ prepare changelogs :end ============== # + +build_appstore() { + cd $project_dir; + yarn; + yarn syncrnversion; + cd $project_dir/ios; + bundle install && bundle exec pod install; + cd $project_dir; + bundle exec fastlane ios appstore; +} + +if [[ -z $SKIP_BUILD || ! -f $ouput_dir/RabbyMobile.ipa ]]; then + echo "[deploy-ios-appstore] start build..." + build_appstore; + echo "[deploy-ios-appstore] finish build." +fi + +file_date=$(date -r $ouput_dir/RabbyMobile.ipa '+%Y%m%d_%H%M%S') +version_bundle_name="${ios_version_name}.${ios_version_code}-$file_date" +deployment_s3_dir=$S3_IOS_PUB_DEPLOYMENT/ios-$version_bundle_name +deployment_cdn_baseurl=$cdn_deployment_urlbase/ios-$version_bundle_name +manifest_plist_url="itms-services://?action=download-manifest&url=$deployment_cdn_baseurl/manifest.plist" + +staging_dirname=ios-$version_bundle_name$staging_dir_suffix +backup_s3_dir=$S3_IOS_BAK_DEPLOYMENT/$staging_dirname + +release_s3_dir=$S3_IOS_PUB_DEPLOYMENT/ios +release_cdn_baseurl=$cdn_deployment_urlbase/ios + +echo "" + +if [ "$REALLY_UPLOAD" == "true" ]; then + echo "[deploy-ios-appstore] will be backup at $backup_s3_dir (not public)" + # aws s3 sync $deployment_local_dir $backup_s3_dir/ --exclude '*' --include "*.json" --acl authenticated-read --content-type application/json --exact-timestamps + aws s3 sync $deployment_local_dir $backup_s3_dir/ --exclude '*' --include "*.md" --acl authenticated-read --content-type text/plain --exact-timestamps + + echo "" + echo "[deploy-ios-appstore] to refresh changelog, you could execute:" + # echo "[deploy-ios-appstore] aws s3 sync $backup_s3_dir/ $release_s3_dir/ --exclude '*' --include \"*.json\" --acl public-read" + echo "[deploy-ios-appstore] aws s3 sync $backup_s3_dir/ $release_s3_dir/ --exclude '*' --include \"*.md\" --acl public-read" + echo "" + echo "[deploy-ios-appstore] after sync, will public at $release_s3_dir, served as $release_cdn_baseurl" + echo "" +fi + +[ -z $RABBY_MOBILE_CDN_FRONTEND_ID ] && RABBY_MOBILE_CDN_FRONTEND_ID="" + +if [ -z $CI ]; then + echo "[deploy-ios-appstore] force fresh CDN:" + echo "[deploy-ios-appstore] \`aws cloudfront create-invalidation --distribution-id $RABBY_MOBILE_CDN_FRONTEND_ID --paths '/$s3_upload_prefix/ios/*'\`" + echo "" +fi + +echo "[deploy-ios-appstore] finish sync." diff --git a/apps/mobile/scripts/fns.sh b/apps/mobile/scripts/fns.sh index 7d76a765d..b6e2670e8 100755 --- a/apps/mobile/scripts/fns.sh +++ b/apps/mobile/scripts/fns.sh @@ -45,6 +45,8 @@ checkout_s3_pub_deployment_params() { "appstore"|"selfhost") S3_ANDROID_PUB_DEPLOYMENT=$RABBY_MOBILE_PROD_PUB_DEPLOYMENT export S3_ANDROID_BAK_DEPLOYMENT=$RABBY_MOBILE_PROD_BAK_DEPLOYMENT + S3_IOS_PUB_DEPLOYMENT=$RABBY_MOBILE_PROD_PUB_DEPLOYMENT + export S3_IOS_BAK_DEPLOYMENT=$RABBY_MOBILE_PROD_BAK_DEPLOYMENT ;; "selfhost-reg") S3_ANDROID_PUB_DEPLOYMENT=$RABBY_MOBILE_REG_PUB_DEPLOYMENT diff --git a/apps/mobile/src/changeLogs/0.1.9.md b/apps/mobile/src/changeLogs/0.1.9.md new file mode 100644 index 000000000..a1b81837b --- /dev/null +++ b/apps/mobile/src/changeLogs/0.1.9.md @@ -0,0 +1,4 @@ +### Features + +- Supported Gas Free +- Supported Token Detail Poup