-
-
Notifications
You must be signed in to change notification settings - Fork 71
/
.drone.yml
233 lines (228 loc) · 10 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
kind: pipeline
type: docker
name: linux nightly (amd64)
platform:
os: linux
arch: amd64
trigger:
branch:
- dev
- main
event:
- push
steps:
- name: build linux
image: cirrusci/flutter:3.0.5
commands:
# Install dependencies
- apt-get update -y
- apt-get install -y cmake ninja-build clang pkg-config libgtk-3-dev liblzma-dev libblkid-dev libsecret-1-dev libolm-dev libolm3 libsqlite3-dev libjsoncpp-dev libsqlcipher-dev
- git submodule update --init --recursive
# Set up flutter config
- flutter config --no-analytics
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
- flutter config --enable-linux-desktop
# Build the linux app exec
- flutter build linux --release
- cp -aL /usr/lib/x86_64-linux-gnu/libjsoncpp.so* build/linux/x64/release/bundle/lib/
- cp -aL /usr/lib/x86_64-linux-gnu/libsqlite3.so build/linux/x64/release/bundle/lib/
- cp -aL /usr/lib/x86_64-linux-gnu/libsqlcipher.so build/linux/x64/release/bundle/lib/
- tar -cvzf syphon.nightly.linux.x64.tar.gz -C build/linux/x64/release/bundle .
- shasum -a 256 ./syphon.nightly.linux.x64.tar.gz
- name: release linux
image: golang:1.17
environment:
GITEA_SERVER_TOKEN:
from_secret: GITEA_API_TOKEN
commands:
# Modify the existing release and add the android apk
- go install code.gitea.io/tea@latest
- tea login add -u https://git.syphon.org -n syphon-bot
- tea releases create --tag "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-linux" --target ${DRONE_COMMIT_SHA} --repo syphon-org/syphon --title "${DRONE_BRANCH}-nightly-linux" --asset ./syphon.nightly.linux.x64.tar.gz
---
kind: pipeline
type: docker
name: linux branch build
platform:
os: linux
arch: amd64
trigger:
branch:
exclude:
- dev
- main
event:
- push
steps:
- name: build linux
image: cirrusci/flutter:3.0.5
commands:
# Install dependencies
- apt-get update -y
- apt-get install -y cmake ninja-build clang pkg-config libgtk-3-dev liblzma-dev libblkid-dev libsecret-1-dev libolm-dev libolm3 libsqlite3-dev libjsoncpp-dev libsqlcipher-dev
- git submodule update --init --recursive
# Set up flutter config
- flutter config --no-analytics
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
- flutter config --enable-linux-desktop
# Build the linux app exec
- flutter build linux --release
- cp -aL /usr/lib/x86_64-linux-gnu/libjsoncpp.so* build/linux/x64/release/bundle/lib/
- cp -aL /usr/lib/x86_64-linux-gnu/libsqlite3.so build/linux/x64/release/bundle/lib/
- cp -aL /usr/lib/x86_64-linux-gnu/libsqlcipher.so build/linux/x64/release/bundle/lib/
- tar -cvzf syphon.$(echo $DRONE_COMMIT_SHA | cut -c1-7).linux.x64.tar.gz -C build/linux/x64/release/bundle .
- shasum -a 256 ./syphon.$(echo $DRONE_COMMIT_SHA | cut -c1-7).linux.x64.tar.gz
- name: release linux
image: golang:1.17
environment:
GITEA_SERVER_TOKEN:
from_secret: GITEA_API_TOKEN
commands:
# Modify the existing release and add the android apk
- go install code.gitea.io/tea@latest
- tea login add -u https://git.syphon.org -n syphon-bot
- tea releases create --tag "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-linux" --target ${DRONE_COMMIT_SHA} --repo syphon-org/syphon --title "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-linux" --asset ./syphon.$(echo $DRONE_COMMIT_SHA | cut -c1-7).linux.x64.tar.gz
---
#kind: pipeline
#type: docker
#name: linux nightly (arm64)
#platform:
# os: linux
# arch: arm64
#trigger:
# branch:
# - dev
# - main
# event:
# - push
#steps:
# - name: build linux
# image: cirrusci/flutter:3.0.5
# commands:
# # Install dependencies
# - apt-get update -y
# - apt-get install -y cmake ninja-build clang pkg-config libgtk-3-dev liblzma-dev libblkid-dev libsecret-1-dev libolm-dev libolm3 libsqlite3-dev libjsoncpp-dev libsqlcipher-dev
# - git submodule update --init --recursive
# # Set up flutter config
# - flutter config --no-analytics
# - flutter pub get
# - flutter pub run build_runner build --delete-conflicting-outputs
# - flutter config --enable-linux-desktop
# # Build the linux app exec
# - flutter build linux --release
# - cp -aL /usr/lib/aarch64-linux-gnu/libjsoncpp.so* build/linux/arm64/release/bundle/lib/
# - cp -aL /usr/lib/aarch64-linux-gnu/libsqlite3.so build/linux/arm64/release/bundle/lib/
# - cp -aL /usr/lib/aarch64-linux-gnu/libsqlcipher.so build/linux/arm64/release/bundle/lib/
# - tar -cvzf syphon.nightly.linux.x64.tar.gz -C build/linux/arm64/release/bundle .
# - name: release linux
# image: golang:1.15
# environment:
# GITEA_SERVER_TOKEN:
# from_secret: GITEA_API_TOKEN
# commands:
# # Modify the existing release and add the android apk
# - go get code.gitea.io/tea
# - go install code.gitea.io/tea
# - tea login add -u https://git.syphon.org
# - tea releases create --tag "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-linux" --target ${DRONE_COMMIT_SHA} --repo syphon-org/syphon --title "${DRONE_BRANCH}-nightly-linux" --asset ./syphon.nightly.linux.x64.tar.gz
# ---
kind: pipeline
type: docker
name: android nightly
trigger:
branch:
- dev
- main
event:
- push
steps:
- name: build android
image: cirrusci/flutter:3.0.5
commands:
# Keep track of the time when build was started
- echo $(date -Iseconds) > BUILD_START_TIME
# Environment variables
- export DEBIAN_FRONTEND=noninteractive
- export ANDROID_NDK_HOME=/opt/android-sdk-linux/ndk-bundle/
# Install dependencies (git should be pre-installed)
- apt-get update && apt-get install --no-install-recommends -y cmake ninja-build
- git submodule update --init --recursive
- sdkmanager "ndk-bundle"
# Set up flutter
- flutter config --no-analytics
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
# Modify gradle build script (remove/change parts which don't work in this environment)
- sed -i '/keystoreProperties\[/d' android/app/build.gradle
- sed -i 's/version "3.10.2"/version "3.7.0+"/g' android/app/build.gradle
- sed -i 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/g' android/app/build.gradle
# Modify package and app name to allow for installing alongside normal Syphon
- sed -i 's/android:label="Syphon"/android:label="Syphon Nightly"/g' android/app/src/main/AndroidManifest.xml
- sed -i 's/applicationId "org.tether.tether"/applicationId "org.syphon.syphon.nightly"/g' android/app/build.gradle
# Modify the default ic_launcher to the nightly version
- sed -i 's/ic_launcher_background">#34C7B5/ic_launcher_background">#161616/g' android/app/src/main/res/values/colors.xml
# Build the APK
- flutter build apk
- cp build/app/outputs/flutter-apk/app-release.apk ./syphon.nightly.android.apk
- name: release android
image: golang:1.17
environment:
GITEA_SERVER_TOKEN:
from_secret: GITEA_API_TOKEN
commands:
# Modify the existing release and add the android apk
- go install code.gitea.io/tea@latest
- tea login add -u https://git.syphon.org -n syphon-bot
- tea releases create --tag "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-android" --target ${DRONE_COMMIT_SHA} --repo syphon-org/syphon --title "${DRONE_BRANCH}-nightly-android" --asset ./syphon.nightly.android.apk
---
kind: pipeline
type: docker
name: android branch build
trigger:
branch:
exclude:
- dev
- main
event:
- push
steps:
- name: build android
image: cirrusci/flutter:3.0.5
commands:
# Keep track of the time when build was started
- echo $(date -Iseconds) > BUILD_START_TIME
# Environment variables
- export DEBIAN_FRONTEND=noninteractive
- export ANDROID_NDK_HOME=/opt/android-sdk-linux/ndk-bundle/
# Install dependencies (git should be pre-installed)
- apt-get update && apt-get install --no-install-recommends -y cmake ninja-build
- git submodule update --init --recursive
- sdkmanager "ndk-bundle"
# Set up flutter
- flutter config --no-analytics
- flutter pub get
- flutter pub run build_runner build --delete-conflicting-outputs
# Modify gradle build script (remove/change parts which don't work in this environment)
- sed -i '/keystoreProperties\[/d' android/app/build.gradle
- sed -i 's/version "3.10.2"/version "3.7.0+"/g' android/app/build.gradle
- sed -i 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/g' android/app/build.gradle
# Modify package and app name to allow for installing alongside normal Syphon
- sed -i 's/android:label="Syphon"/android:label="Syphon Nightly"/g' android/app/src/main/AndroidManifest.xml
- sed -i 's/applicationId "org.tether.tether"/applicationId "org.syphon.syphon.nightly"/g' android/app/build.gradle
# Modify the default ic_launcher to the nightly version
- sed -i 's/ic_launcher_background">#34C7B5/ic_launcher_background">#161616/g' android/app/src/main/res/values/colors.xml
# Build the APK
- flutter build apk
- cp build/app/outputs/flutter-apk/app-release.apk ./syphon.$(echo $DRONE_COMMIT_SHA | cut -c1-7).android.apk
- name: release android
image: golang:1.17
environment:
GITEA_SERVER_TOKEN:
from_secret: GITEA_API_TOKEN
commands:
# Modify the existing release and add the android apk
- go install code.gitea.io/tea@latest
- tea login add -u https://git.syphon.org -n syphon-bot
- tea releases create --tag "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-android" --target ${DRONE_COMMIT_SHA} --repo syphon-org/syphon --title "${DRONE_BRANCH}-$(echo $DRONE_COMMIT_SHA | cut -c1-7)-android" --asset ./syphon.$(echo $DRONE_COMMIT_SHA | cut -c1-7).android.apk