This commit is contained in:
parent
c2d8681ce8
commit
39f369f8fc
141
.drone.yml
141
.drone.yml
@ -13,130 +13,29 @@ steps:
|
|||||||
- echo "Building..."
|
- echo "Building..."
|
||||||
- ./gradlew build -x test
|
- ./gradlew build -x test
|
||||||
- echo "---------------------------------------------------------"
|
- echo "---------------------------------------------------------"
|
||||||
- echo "Testing..."
|
- cat androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- ./gradlew koverMergedXmlReport
|
|
||||||
environment:
|
environment:
|
||||||
TZ: Europe/Paris
|
TZ: Europe/Paris
|
||||||
SONAR_HOST_URL:
|
- name: notify
|
||||||
from_secret: sonarScannerHostUrl
|
image: drillster/drone-email
|
||||||
SONAR_LOGIN:
|
|
||||||
from_secret: sonarScannerLogin
|
|
||||||
- name: Analyse
|
|
||||||
image: kytay/sonar-node-plugin
|
|
||||||
settings:
|
settings:
|
||||||
sonar_host:
|
host:
|
||||||
from_secret: sonarScannerHostUrl
|
from_secret: smtpHOST
|
||||||
sonar_token:
|
port:
|
||||||
from_secret: sonarScannerLogin
|
from_secret: smtpPORT
|
||||||
use_node_version: 16.18.1
|
username:
|
||||||
sonar_debug: true
|
from_secret: smtpUSERNAME
|
||||||
sonar_project_settings: ./sonar-project.properties
|
password:
|
||||||
|
from_secret: smtpPASSWORD
|
||||||
|
from:
|
||||||
|
from_secret: smtpFROM
|
||||||
|
subject: Mapping file
|
||||||
|
recipients:
|
||||||
|
from_secret: smtpTO
|
||||||
|
recipients_only: true
|
||||||
|
skip_verify: true
|
||||||
|
attachment: androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: Publish
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: createTagAndChangelog
|
|
||||||
image: ubuntu:latest
|
|
||||||
commands:
|
|
||||||
- apt-get update && apt-get install -y git
|
|
||||||
- git fetch --tags -p
|
|
||||||
- PREV=$(git describe --tags --abbrev=0)
|
|
||||||
- ./build.sh --publish --from-ci
|
|
||||||
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
|
||||||
- VER=$(git describe --tags --abbrev=0)
|
|
||||||
- CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
|
|
||||||
- echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
|
||||||
- git add CHANGELOG.md
|
|
||||||
- git commit -m "Changelog for $VER [CI SKIP]"
|
|
||||||
- git push pushing master
|
|
||||||
- git push pushing --tags
|
|
||||||
environment:
|
|
||||||
TZ: Europe/Paris
|
|
||||||
GITEA_USR:
|
|
||||||
from_secret: giteaUsr
|
|
||||||
GITEA_PASS:
|
|
||||||
from_secret: giteaPass
|
|
||||||
|
|
||||||
- name: scpFiles
|
|
||||||
image: appleboy/drone-scp
|
|
||||||
settings:
|
|
||||||
host: amine-louveau.fr
|
|
||||||
username: ubuntu
|
|
||||||
key:
|
|
||||||
from_secret: privateKey
|
|
||||||
port: 22
|
|
||||||
target: /home/ubuntu/
|
|
||||||
source: version.txt
|
|
||||||
|
|
||||||
- name: deploy
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
settings:
|
|
||||||
host: amine-louveau.fr
|
|
||||||
user: ubuntu
|
|
||||||
key:
|
|
||||||
from_secret: privateKey
|
|
||||||
command_timeout: 2m
|
|
||||||
script:
|
|
||||||
- cd /home/ubuntu && sudo rm -rf /var/www/amine/version.txt && sudo chown www-data:www-data ./version.txt && sudo mv version.txt /var/www/amine/
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- promote
|
|
||||||
target:
|
|
||||||
- production
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: Release
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: mingc/android-build-box:latest
|
|
||||||
commands:
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Fetch tags..."
|
|
||||||
- git fetch --tags
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Configure gradle..."
|
|
||||||
- mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=false\npushCache=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Generate APK"
|
|
||||||
- ./gradlew :androidApp:assembleGithubConfigRelease -P pushCache=false
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Get Key"
|
|
||||||
- wget https://amine-louveau.fr/key
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Zipalign"
|
|
||||||
- $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
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Sign"
|
|
||||||
- $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
|
|
||||||
- echo "---------------------------------------------------------"
|
|
||||||
- echo "Verify"
|
|
||||||
- $ANDROID_HOME/build-tools/31.0.0/apksigner verify signed.apk
|
|
||||||
environment:
|
|
||||||
TZ: Europe/Paris
|
|
||||||
YOUR_KEYSTORE_PASSWORD:
|
|
||||||
from_secret: keyPass
|
|
||||||
YOUR_KEY_ALIAS:
|
|
||||||
from_secret: keyAlias
|
|
||||||
|
|
||||||
- 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
|
|
Loading…
Reference in New Issue
Block a user