代码拉取完成,页面将自动刷新
version: 2
workflows:
version: 2
default:
jobs:
- primary:
filters:
tags:
only: /.*/
branches:
only: /.*/
- release:
filters:
tags:
only: /.*/
branches:
ignore: /.*/
# ------------------------------------------------------------------------------
jobs:
primary:
docker:
- image: mbgl/android-ndk-r21:769c31f1d8
working_directory: ~/code
environment:
JVM_OPTS: -Xmx3200m
BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false
GRADLE_OPTS: -Xmx4096m -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "MapboxAndroidDemo/build.gradle" }}
- run:
name: Clean gradle
command: ./gradlew clean
- run:
name: Add preferences to gradle.properties file
command: |
echo "android.useAndroidX=true" >> gradle.properties
echo "android.enableJetifier=true" >> gradle.properties
echo "org.gradle.jvmargs=-Xmx4608m" >> gradle.properties
echo "android.enableR8=false" >> gradle.properties
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "MapboxAndroidDemo/build.gradle" }}
- run:
name: Create google-services.json file
shell: /bin/bash -euo pipefail
command: |
if [ -n "${GOOGLE_SERVICES_JSON_RELEASE}" ]; then
echo "${GOOGLE_SERVICES_JSON_RELEASE}" > MapboxAndroidDemo/google-services.json
fi
- run:
name: Add Fabric keys to fabric.properties file
command: |
if [ -n "${FABRIC_API_SECRET}" && -n "${FABRIC_API_KEY}" ]; then
echo "${FABRIC_API_SECRET}" >> MapboxAndroidDemo/fabric.properties
echo "${FABRIC_API_KEY}" >> MapboxAndroidDemo/fabric.properties
fi
- run:
name: Log in to Google Cloud Platform
shell: /bin/bash -euo pipefail
command: |
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
gcloud auth activate-service-account --key-file secret.json --project mapbox-android-demo
rm secret.json
- run:
name: Check code style
command: make checkstyle
- run:
name: Generate Espresso sanity tests
command: make sanity-test-example-activities
- run:
name: Run Firebase instrumentation tests
command: |
#!/bin/bash
./gradlew :MapboxAndroidDemo:assembleglobalDebug --continue
./gradlew :MapboxAndroidDemo:assembleAndroidTest --continue
gcloud firebase test android run \
--type instrumentation \
--app MapboxAndroidDemo/build/outputs/apk/global/debug/MapboxAndroidDemo-global-debug.apk \
--test MapboxAndroidDemo/build/outputs/apk/androidTest/global/debug/MapboxAndroidDemo-global-debug-androidTest.apk \
--device-ids sailfish --os-version-ids 26 --locales en --orientations portrait --timeout 5m
- store_artifacts:
path: MapboxAndroidDemo/build/outputs/apk/global/debug/MapboxAndroidDemo-global-debug.apk
# ------------------------------------------------------------------------------
release:
docker:
- image: mbgl/android-ndk-r21:769c31f1d8
working_directory: ~/code
environment:
JVM_OPTS: -Xmx3200m
BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false
GRADLE_OPTS: -Xmx4096m -Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "MapboxAndroidDemo/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "MapboxAndroidDemo/build.gradle" }}
- run:
name: Export developer-config.xml & Google Play authentication json
command: |
#!/bin/bash
echo "${PLAY_PUBLISH_AUTH_JSON}" > android-gl-native-6d21dd280e7b.json
- run:
name: Create google-services.json file
shell: /bin/bash -euo pipefail
command: |
if [ -n "${GOOGLE_SERVICES_JSON_RELEASE}" ]; then
echo "${GOOGLE_SERVICES_JSON_RELEASE}" > MapboxAndroidDemo/google-services.json
fi
- run:
name: Release to Google Play
command: ./gradlew publishGlobalRelease
# ------------------------------------------------------------------------------
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。