Skip to content

Instantly share code, notes, and snippets.

@mega-arbuz
Last active October 30, 2020 12:38
Show Gist options
  • Save mega-arbuz/927a51708251b91b8acea2bb75a330b8 to your computer and use it in GitHub Desktop.
Save mega-arbuz/927a51708251b91b8acea2bb75a330b8 to your computer and use it in GitHub Desktop.
GitLab CI yml
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: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment