GitLab CI에서 안드로이드 앱 빌드-테스트-서명 및 배포

2020. 1. 20. 07:35안드로이드 개발

https://android.jlelse.eu/android-gitlab-ci-cd-sign-deploy-3ad66a8f24bf

 

Android CI/CD with GitLab — Build, Test, Sign, Upload to Dropbox and send an Email

I’ve been working on an Android app, that was in early demo stage and not released to the Play Store yet. After a while I found myself…

android.jlelse.eu

The .gitlab-ci.yml file is completed and the result should look like this:

image: jangrewe/gitlab-ci-android

before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew

cache:
  key: ${CI_PROJECT_ID}
  paths:
  - .gradle/

stages:
- build
- test
- release
- deploy

lintDebug:
  stage: build
  script:
  - ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint

assembleDebug:
  stage: build
  script:
  - ./gradlew assembleDebug

testDebug:
  stage: test
  script:
  - ./gradlew -Pci --console=plain :app:testDebug

assembleRelease:
  stage: release
  script:
  - echo $KEYSTORE_FILE | base64 -d > my.keystore
  - ./gradlew assembleRelease
    -Pandroid.injected.signing.store.file=$(pwd)/my.keystore
    -Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD
    -Pandroid.injected.signing.key.alias=$KEY_ALIAS
    -Pandroid.injected.signing.key.password=$KEY_PASSWORD
  artifacts:
    paths:
    - app/build/outputs/apk/release
    - CHANGELOG

deployRelease:
  image: python:3.5.2
  stage: deploy
  script:
  - pip install requests
  - git clone https://github.com/mega-arbuz/apk-release-deploy.git
  - python apk-release-deploy/deploy.py
    --release.dir=app/build/outputs/apk/release
    --app.name=BestAppEver
    --dropbox.token=$DROPBOX_TOKEN
    --dropbox.folder=release
    --changelog.file=CHANGELOG
    --template.file=TEMPLATE
    --zapier.hook=$ZAPIER_EMAIL_HOOK
    --email.to=$EMAIL_TARGET
  cache: {}

https://gitlab.com/arbuz/android-ci-cd

 

Oleg Shnaydman / Android CI-CD

Project with Android CI/CD pipelines that will build, test, release, sign, upload to Dropbox and send an email with a download link and latest changes.

gitlab.com

https://github.com/mega-arbuz/apk-release-deploy

 

mega-arbuz/apk-release-deploy

Deploy APK file with changelog for Android projects with CI/CD. - mega-arbuz/apk-release-deploy

github.com