From 5d9c887e6359ba9a5e4cf812ff597ed693c35900 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Wed, 14 Sep 2022 06:53:37 +0200 Subject: [PATCH] Workflow --- .drone.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index f4ec65d..fbca5e5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,13 +1,55 @@ kind: pipeline type: docker -name: Deploy +name: test steps: + - name: code-analysis + image: mingc/android-build-box:latest + failure: ignore + commands: + - ls -la + - ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" + environment: + SONAR_HOST_URL: + from_secret: sonarScannerHostUrl + SONAR_LOGIN: + from_secret: sonarScannerLogin - - name: build-and-sign + - name: generateApk + image: mingc/android-build-box:latest + commands: + - ./gradlew :androidApp:build -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false + +--- +kind: pipeline +type: docker +name: Publish + +steps: + - name: createTag + commands: + - ./build.sh + +trigger: + event: + - promote + target: + - production + +--- +kind: pipeline +type: docker +name: Release + +steps: + - name: build image: mingc/android-build-box:latest commands: - ./gradlew :androidApp:assembleGithubConfigRelease -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false + + - name: sign + image: mingc/android-build-box:latest + commands: - wget https://amine-louveau.fr/key - $ANDROID_HOME/build-tools/31.0.0/zipalign -f -v 4 androidApp/build/outputs/apk/githubConfig/release/androidApp-githubConfig-release-unsigned.apk androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk - $ANDROID_HOME/build-tools/31.0.0/apksigner sign -v --out signed.apk --ks ./key --ks-key-alias $YOUR_KEY_ALIAS --ks-pass pass:$YOUR_KEYSTORE_PASSWORD --v1-signing-enabled true --v2-signing-enabled true androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk @@ -18,7 +60,13 @@ steps: YOUR_KEY_ALIAS: from_secret: keyAlias -volumes: - - name: cache - host: - path: /tmp/cache \ No newline at end of file + - name: gitea_release + image: plugins/gitea-release + settings: + api_key: + from_secret: giteaAPI + base_url: https://gitea.amine-louveau.fr + files: signed.apk +trigger: + event: + - tag \ No newline at end of file