forked from lamarios/clipious
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
83 lines (81 loc) · 2.91 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
kind: pipeline
type: docker
name: Android app
steps:
- name: Build app
image: ghcr.io/cirruslabs/flutter:stable
environment:
ANDROID_KEY_FILE: /tmp/key.properties
SERVER_URL:
from_secret: server_url
commands:
- wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json
- wget http://$SERVER_URL/key.properties -O /tmp/key.properties
- wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks
- cd ..
- cp -R src /tmp/build
- cd /tmp/build
- git submodule init
- git submodule update
- export PUB_CACHE=$(pwd)/.pub-cache
- ./submodules/flutter/bin/flutter doctor
- ./submodules/flutter/bin/flutter config --no-analytics
- ./submodules/flutter/bin/flutter pub get
- ./submodules/flutter/bin/flutter pub run flutter_native_splash:create
- ./submodules/flutter/bin/flutter build apk --split-per-abi
- ./submodules/flutter/bin/flutter build apk
- ./submodules/flutter/bin/flutter build appbundle
- cd /drone/src/
- mkdir -p build/app/outputs/flutter-apk
- mkdir -p build/app/outputs/bundle/release
- cp /tmp/build/build/app/outputs/flutter-apk/* build/app/outputs/flutter-apk/
- cp /tmp/build/build/app/outputs/bundle/release/* build/app/outputs/bundle/release/
- ls build/app/outputs/flutter-apk/
- ls build/app/outputs/bundle/release/
when:
event: tag
- name: Accrescent APKs
image: gonzague/bundletool
environment:
ANDROID_KEY_FILE: /tmp/key.properties
SERVER_URL:
from_secret: server_url
commands:
- mkdir /tmp
- wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json
- wget http://$SERVER_URL/key.properties -O /tmp/key.properties
- wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks
- . /tmp/key.properties
- cd build/app/outputs/bundle/release/
- bundletool build-apks --bundle=app-release.aab --output=app-release.apks --ks-pass=pass:$${storePassword} --ks=/tmp/keystore.jks --ks-key-alias=upload --key-pass=pass:$${keyPassword} --aapt2=/bin/aapt2
when:
event: tag
- name: Publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- "build/app/outputs/flutter-apk/*"
- "build/app/outputs/bundle/release/*"
when:
event: tag
#- name: Release Android
# image: ruby
# environment:
# JSON_KEY_FILE: /tmp/service-account.json
# SERVER_URL:
# from_secret: server_url
# commands:
# - wget http://$SERVER_URL/service-account.json -O /tmp/service-account.json
# - wget http://$SERVER_URL/key.properties -O /tmp/key.properties
# - wget http://$SERVER_URL/keystore.jks -O /tmp/keystore.jks
# - cd android
# - gem install fastlane
# - fastlane deploy
# when:
# event: tag
# trigger:
# event:
# - push
# - tag