--- kind: pipeline type: docker name: Android steps: - name: prepare signing image: busybox environment: STOREPASSWORD: from_secret: StorePassword KEYPASSWORD: from_secret: KeyPassword commands: - touch keystore.properties - echo "storePassword=$STOREPASSWORD" >> keystore.properties - echo "keyPassword=$KEYPASSWORD" >> keystore.properties - echo "keyAlias=key0" >> keystore.properties - echo "storeFile=../AndroidKey" >> keystore.properties - name: generate versionCode image: busybox commands: - touch version.properties - let timestamp=$(date +%s)/10 - echo "versionCode=$timestamp" >> version.properties - name: build image: mingc/android-build-box commands: - ./gradlew test - ./gradlew assembleRelease - ./gradlew bundleRelease - name: deploy latest build image: busybox volumes: - name: deploy path: /tmp/deploy commands: - mkdir -p /tmp/deploy/lastBuild - cp ./app/build/outputs/apk/release/app-release.apk /tmp/deploy/lastBuild/app-release_latest.apk - cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/lastBuild/app-release_latest.aab - name: deploy tagged build image: busybox volumes: - name: deploy path: /tmp/deploy commands: - mkdir -p /tmp/deploy/tagged/$DRONE_TAG - cp ./app/build/outputs/apk/debug/app-debug.apk /tmp/deploy/tagged/$DRONE_TAG/app-debug_$DRONE_TAG.apk - cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/tagged/$DRONE_TAG/app-release_$DRONE_TAG.aab when: event: - tag - name: slack notification image: plugins/slack settings: webhook: from_secret: SlackWebhook volumes: - name: deploy host: path: /mnt/seafile-sync-cli/TichuCounter