android - Gitlab CI google Drive
问题描述
I have setup a very basic CI on gitlab for my android project and I was wondering if there was a way to send the apk that is built to a google drive somewhere so an email can be sent with a link to the apk? I was also wondering if there was a way to only do the build if pushed/merged on a particular branch.
I used the template yml file in the gitlab example.
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip -d android-sdk-linux android-sdk.zip
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
stages:
- build
lintDebug:
stage: build
script:
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint
assembleDebug:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
解决方案
推荐阅读
- azure-eventhub - Azure 事件中心消费者组
- sql-server - 解析 XML 节点 Key:Value
- python - 访问大型 2D numpy 数组中的多个索引
- cocoa-touch - 如何仅在 SwiftUI 中将拖动手势限制为一个方向?
- javascript - 为 Chrome 77 上的 google recaptcha v2 警告尝试 SameSite 属性修复似乎对我不起作用?
- ajax - Laravel Blade Uncaught SyntaxError:Ajax 中的输入意外结束
- flutter - Dart - 将 Webfeed 转换为 Json
- c++ - 我可以#define 多深?
- php - 与 exec 一起表演的作曲家
- sql - 超链接表达式的多个字段