diff --git a/client/mobile/src/lib/notifications/index.ts b/client/mobile/src/lib/notifications/index.ts index d6ca3c89..43dcd3f1 100644 --- a/client/mobile/src/lib/notifications/index.ts +++ b/client/mobile/src/lib/notifications/index.ts @@ -67,8 +67,8 @@ async function initForegroundService() { const channelId = await createDefaultChannel(); notifee.displayNotification({ - title: 'Foreground service', - body: 'This notification will exist for the lifetime of the service runner', + title: 'Tailchat', + body: '持续保持服务正常运行, 关闭后可能无法正常接受到消息推送', android: { channelId, asForegroundService: true, diff --git a/codemagic.yaml b/codemagic.yaml new file mode 100644 index 00000000..44020b58 --- /dev/null +++ b/codemagic.yaml @@ -0,0 +1,41 @@ +workflows: + android: + name: build, test & publish Android version + max_build_duration: 30 + instance_type: mac_mini_m1 + working_directory: client/mobile + cache: + cache_paths: + - $CM_BUILD_DIR/node_modules + scripts: + - name: Install npm dependencies + script: | + yarn + - name: Set Android SDK location + script: | + echo "sdk.dir=$ANDROID_SDK_ROOT" > "./android/local.properties" + - name: Build Android release + working_directory: client/mobile/android + script: | + UPDATED_BUILD_NUMBER=$BUILD_NUMBER + ./gradlew assembleRelease \ + -PversionCode=$UPDATED_BUILD_NUMBER \ + -PversionName=1.0.$UPDATED_BUILD_NUMBER + artifacts: + - android/app/build/outputs/**/**/*.apk + publishing: + email: + recipients: + - moonrailgun@gmail.com + scripts: + - name: To get artifact URL + script: | + ARTIFACT_TYPE=".apk" + ARTIFACT_URL=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | select(.name | endswith("'"$ARTIFACT_TYPE"'")) | .url') + + # ios: + # name: build, test & publish iOS version + # instance_type: mac_pro + # working_directory: client/mobile + # scripts: + # - ...