Created
March 5, 2019 06:33
-
-
Save santiq/8bf594ec29b78a615e424fdff178292f to your computer and use it in GitHub Desktop.
Automate generation Ionic App APK with CircleCI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/android:api-28-node | |
working_directory: ~/repo | |
environment: | |
JVM_OPTS: -Xmx3200m | |
steps: | |
- checkout | |
- run: | |
name: "Install gradle" | |
command: | | |
wget https://services.gradle.org/distributions/gradle-4.0.2-bin.zip -P /tmp | |
sudo unzip -d /opt/gradle /tmp/gradle-*.zip | |
echo 'export GRADLE_HOME=/opt/gradle/gradle-4.0.2' >> $BASH_ENV | |
echo 'export PATH=$PATH:/opt/gradle/gradle-4.0.2/bin' >> $BASH_ENV | |
source $BASH_ENV | |
- run: | |
name: "Install ionic and cordova" | |
command: | | |
sudo npm install -g ionic cordova yarn | |
- run: | |
name: "Install npm packages" | |
command: | | |
yarn install | |
- run: | |
name: "Install Cordova plugins and add android platform" | |
command: | | |
ionic cordova platform add android --noresources | |
ionic config set -g telemetry true | |
- run: | |
name: "Generate apk" | |
command: | | |
ionic cordova build android --verbose | |
mkdir -p /tmp/apk | |
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk | |
- store_artifacts: | |
path: /tmp/apk | |
destination: apks | |
workflows: | |
version: 2 | |
build_and_deploy: | |
jobs: | |
- build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment