-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
124 lines (123 loc) · 3.26 KB
/
codemagic.yaml
File metadata and controls
124 lines (123 loc) · 3.26 KB
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
# Has a separate flows for develop branch (automatic builds),
# Merge Request (automatic builds) and main branch Release builds (manual builds).
definitions:
artifacts: &androidArtifacts # Section def
- emulator.log
- app-demo/build/reports
- app-demo/build/outputs/androidTest-results
- app-demo/build/outputs/logs
- app-demo/build/outputs/**/*.apk
- app-demo/build/outputs/**/*.aab
- app-demo/build/outputs/**/mapping.txt
- lib/build/reports
- lib/build/outputs/androidTest-results
- lib/build/outputs/logs
- lib/build/outputs/**/*.aar
- lib/build/outputs/**/mapping.txt
debug-emails: &debugEmails
- lauris.kruusamae@lab.mobi
- harri.kirik@lab.mobi
release-emails: &releaseEmails
- lauris.kruusamae@lab.mobi
- harri.kirik@lab.mobi
scripts:
# Local setup
- &stepLocalSetup
name: Set up local properties and permissions
script: |
chmod +x gradlew
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$FCI_BUILD_DIR/local.properties"
# Run checkCode
- &stepCheckCode
name: Check code style and formatting
script: ./gradlew checkCode
# Build DEBUG
- &stepBuildDebug
name: Build Android
script: ./gradlew clean buildAllDebug
# Build RELEASE
- &stepBuildRelease
name: Build Library
script: ./gradlew clean buildAllRelease
# Build PUBLISH
- &stepBuildPublish
name: Publish to Maven Central
script: |
./gradlew buildAndPublishRelease
# Flows
workflows:
release-builds:
name: Release builds for verification (main branch only)
instance_type: linux_x2
environment:
java: 17
scripts:
- name: Check 'main' branch
script: if [ "$FCI_BRANCH" != "main" ]; then exit 1; fi
- *stepLocalSetup
- *stepCheckCode
- *stepBuildRelease
publishing:
email:
recipients: *releaseEmails
artifacts: *androidArtifacts
publish-builds:
name: Publish to Maven builds (main branch only)
instance_type: linux_x2
environment:
java: 17
groups:
- mavenCentralPublishing
scripts:
- name: Check 'main' branch
script: if [ "$FCI_BRANCH" != "main" ]; then exit 1; fi
- *stepLocalSetup
- *stepCheckCode
- *stepBuildPublish
publishing:
email:
recipients: *releaseEmails
artifacts: *androidArtifacts
develop-builds:
name: Development builds
instance_type: linux_x2
environment:
java: 17
triggering:
events:
- push
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: true
scripts:
- *stepLocalSetup
- *stepCheckCode
- *stepBuildDebug
artifacts: *androidArtifacts
publishing:
email:
recipients: *debugEmails
merge-requests:
name: Merge requests
instance_type: linux_x2
environment:
java: 17
triggering:
events:
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: false
cancel_previous_builds: true
scripts:
- *stepLocalSetup
- *stepCheckCode
- *stepBuildDebug
publishing:
email:
recipients: *debugEmails
notify:
success: false