2022-07-23 20:28:06 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2022-09-14 10:32:00 +00:00
|
|
|
name: test
|
2022-07-23 20:28:06 +00:00
|
|
|
|
|
|
|
steps:
|
2023-10-06 19:12:47 +00:00
|
|
|
- name: Lint
|
|
|
|
failure: ignore
|
|
|
|
detach: true
|
|
|
|
image: mingc/android-build-box:latest
|
|
|
|
commands:
|
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Install linters..."
|
|
|
|
- curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.0/ktlint && chmod a+x ktlint && mv ktlint /usr/local/bin/
|
|
|
|
- curl -sSLO https://github.com/saveourtool/diKTat/releases/download/v1.2.5/diktat-1.2.5.jar && chmod a+x diktat-1.2.5.jar
|
|
|
|
- curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.1/detekt-cli-1.23.1.zip && unzip detekt-cli-1.23.1.zip
|
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Linting..."
|
|
|
|
- ktlint -R diktat-1.2.5.jar "**/*.kt" --log-level=debug
|
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Detecting..."
|
|
|
|
- /detekt-cli-1.23.1/bin/detekt-cli --all-rules=true
|
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
command_timeout: 5m
|
2022-12-13 19:53:23 +00:00
|
|
|
- name: BuildAndTest
|
2022-07-23 20:39:48 +00:00
|
|
|
image: mingc/android-build-box:latest
|
2022-07-23 20:28:06 +00:00
|
|
|
commands:
|
2022-10-30 20:38:04 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Configure gradle..."
|
2022-11-14 12:10:17 +00:00
|
|
|
- mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\npushCache=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
2022-09-14 10:32:00 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
2023-10-06 19:12:47 +00:00
|
|
|
- echo "Building and testing..."
|
|
|
|
- ./gradlew build
|
2022-09-14 10:32:00 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
2023-01-28 10:23:00 +00:00
|
|
|
- pull_request
|
2022-08-17 12:03:32 +00:00
|
|
|
|
2022-09-14 10:32:00 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Publish
|
|
|
|
|
|
|
|
steps:
|
2022-12-28 20:43:56 +00:00
|
|
|
- name: createTagAndChangelog
|
2022-09-14 10:32:00 +00:00
|
|
|
image: ubuntu:latest
|
2022-09-17 19:29:37 +00:00
|
|
|
commands:
|
2022-09-14 10:32:00 +00:00
|
|
|
- apt-get update && apt-get install -y git
|
2022-12-29 12:11:23 +00:00
|
|
|
- git fetch --tags -p
|
2023-02-21 12:59:38 +00:00
|
|
|
- PREV=$(git describe --tags --abbrev=0)
|
2023-02-21 11:20:43 +00:00
|
|
|
- ./build.sh --publish --from-ci
|
|
|
|
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
2022-12-28 20:43:56 +00:00
|
|
|
- VER=$(git describe --tags --abbrev=0)
|
2023-02-21 14:05:32 +00:00
|
|
|
- CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
|
2022-12-28 20:43:56 +00:00
|
|
|
- echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
|
|
|
- git add CHANGELOG.md
|
2022-12-29 13:11:29 +00:00
|
|
|
- git commit -m "Changelog for $VER [CI SKIP]"
|
2022-12-28 20:43:56 +00:00
|
|
|
- git push pushing master
|
2022-09-14 10:32:00 +00:00
|
|
|
- git push pushing --tags
|
|
|
|
environment:
|
2022-12-26 10:28:04 +00:00
|
|
|
TZ: Europe/Paris
|
2022-09-14 10:32:00 +00:00
|
|
|
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
|
2022-09-17 19:29:37 +00:00
|
|
|
|
2022-09-14 10:32:00 +00:00
|
|
|
- name: deploy
|
|
|
|
image: appleboy/drone-ssh
|
|
|
|
settings:
|
|
|
|
host: amine-louveau.fr
|
|
|
|
user: ubuntu
|
|
|
|
key:
|
|
|
|
from_secret: privateKey
|
|
|
|
command_timeout: 2m
|
|
|
|
script:
|
2022-12-26 21:26:28 +00:00
|
|
|
- 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/
|
2022-09-14 10:32:00 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
steps:
|
2022-08-17 12:03:32 +00:00
|
|
|
- name: build
|
|
|
|
image: mingc/android-build-box:latest
|
|
|
|
commands:
|
2022-12-14 20:26:33 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Fetch tags..."
|
|
|
|
- git fetch --tags
|
2022-10-30 20:38:04 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
|
|
|
- echo "Configure gradle..."
|
2022-12-14 20:42:56 +00:00
|
|
|
- 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
|
2022-10-30 20:38:04 +00:00
|
|
|
- echo "---------------------------------------------------------"
|
2022-09-14 10:32:00 +00:00
|
|
|
- echo "Generate APK"
|
2022-10-30 20:38:04 +00:00
|
|
|
- ./gradlew :androidApp:assembleGithubConfigRelease -P pushCache=false
|
2022-09-14 10:32:00 +00:00
|
|
|
- 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:
|
2022-12-26 10:28:04 +00:00
|
|
|
TZ: Europe/Paris
|
2022-09-14 10:32:00 +00:00
|
|
|
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
|
2023-03-16 21:46:31 +00:00
|
|
|
|
|
|
|
- name: notify
|
|
|
|
image: drillster/drone-email
|
|
|
|
failure: ignore
|
|
|
|
settings:
|
|
|
|
host:
|
|
|
|
from_secret: smtpHOST
|
|
|
|
port:
|
|
|
|
from_secret: smtpPORT
|
|
|
|
username:
|
|
|
|
from_secret: smtpUSERNAME
|
|
|
|
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
|
2022-09-14 10:32:00 +00:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- tag
|