-
Notifications
You must be signed in to change notification settings - Fork 23
/
.drone.yml
115 lines (107 loc) · 3.43 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
kind: pipeline
name: default
steps:
- name: restore-cache
image: appleboy/drone-sftp-cache
settings:
server: volla.tech
port: 22
username: drone
key:
from_secret: DRONE_DEPLOY_KEY
path: /cache
restore: true
mount:
- ./.cache/
- name: build-android_arm64_v8a
image: a12e/docker-qt:5.13-android_arm64_v8a
user: root
environment:
CACHE_DIR: ./.cache/
ANDROID_KEYSTORE_FILE_CONTENTS:
from_secret: ANDROID_KEYSTORE_FILE_CONTENTS
ANDROID_KEYSTORE_ALIAS:
from_secret: ANDROID_KEYSTORE_ALIAS
ANDROID_KEYSTORE_PASS:
from_secret: ANDROID_KEYSTORE_PASS
commands:
- export M2_HOME=`realpath -m $CACHE_DIR/.m2`
- export MAVEN_HOME=`realpath -m $CACHE_DIR/.m2`
- export GRADLE_USER_HOME=`realpath -m $CACHE_DIR/.gradle`
- export VERSION=`git describe --tags || git rev-parse --short HEAD`
- export TIMESTAMP=`date +%Y%m%d%H%M`
- export BUILD_ID="$VERSION-$TIMESTAMP"
- mkdir -p $MAVEN_HOME
- mkdir -p $GRADLE_USER_HOME
- mkdir -p releases
- ./build_package_android ./releases
- name: archive-nightly
image: a12e/docker-qt:5.13-android_arm64_v8a
when:
event:
- cron
cron:
- nightly
environment:
DRONE_DEPLOY_KEY:
from_secret: DRONE_DEPLOY_KEY
commands:
- APK_PATH="`realpath ./releases/`"
- KEY_PATH=/tmp/deploykey
- UPLOAD_PATH="/builds/nightly/$DRONE_REPO_OWNER/$DRONE_REPO_NAME/"
- SFTP_OPTIONS="-b - -i $KEY_PATH -o CheckHostIP=no -o StrictHostKeyChecking=no drone@volla.tech"
- echo "$${DRONE_DEPLOY_KEY}" > $KEY_PATH
- chmod 06400 $KEY_PATH
- DIR="$UPLOAD_PATH"; while [ "$DIR" != / ]; do echo -mkdir "$DIR"; DIR=`readlink -fm "$DIR"/..`; done | tac | sftp $SFTP_OPTIONS
- find "$APK_PATH" -type f -name "*.apk" -exec echo -put \"{}\" \;| sftp $SFTP_OPTIONS:$UPLOAD_PATH
- rm $KEY_PATH
- name: archive-release
image: a12e/docker-qt:5.13-android_arm64_v8a
when:
event: tag
environment:
DRONE_DEPLOY_KEY:
from_secret: DRONE_DEPLOY_KEY
commands:
- APK_PATH="`realpath ./releases/`"
- KEY_PATH=/tmp/deploykey
- UPLOAD_PATH="/builds/release/$DRONE_REPO_OWNER/$DRONE_REPO_NAME/"
- SFTP_OPTIONS="-b - -i /tmp/deploykey -o CheckHostIP=no -o StrictHostKeyChecking=no drone@volla.tech"
- echo "$${DRONE_DEPLOY_KEY}" > $KEY_PATH
- chmod 0600 $KEY_PATH
- DIR="$UPLOAD_PATH"; while [ "$DIR" != / ]; do echo -mkdir "$DIR"; DIR=`readlink -fm "$DIR"/..`; done | tac | sftp $SFTP_OPTIONS
- find "$APK_PATH" -type f -name "*.apk" -exec echo -put \"{}\" \;| sftp $SFTP_OPTIONS:$UPLOAD_PATH
- rm $KEY_PATH
#TODO: Make sure the key has the least amount of privileges
- name: update-fdroid
image: plugins/downstream
when:
event:
- cron
- tag
cron:
- nightly
settings:
server: https://drone.volla.tech
token:
from_secret: DRONE_ACCESS_TOKEN
fork: true
repositories:
- volla/fdroid-updater@master
- name: rebuild-cache
image: appleboy/drone-sftp-cache
settings:
server: volla.tech
port: 22
username: drone
key:
from_secret: DRONE_DEPLOY_KEY
path: /cache
rebuild: true
mount:
- ./.cache/
---
kind: signature
hmac: 0923699ed81261e139596a8ce7dca3cc83571b5ea64d6ee0314f76345188a0ca
...