-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
97 lines (96 loc) · 2.62 KB
/
codemagic.yaml
File metadata and controls
97 lines (96 loc) · 2.62 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
# Has a separate flows for develop branch (automatic builds),
# Merge Request (automatic builds) and master branch Release builds (manual builds) and Publishing builds (manual builds).
definitions:
artifacts: &androidArtifacts # Section def
- emulator.log
- scrolls-lib/build/reports
- scrolls-lib/build/outputs/androidTest-results
- scrolls-lib/build/outputs/logs
- scrolls-lib/build/outputs/aar/*.aar
- scrolls-sample-java/build/outputs/apk/**/*.apk
debug-emails: &debugEmails
- harri.kirik@lab.mobi
release-emails: &releaseEmails
- harri.kirik@lab.mobi
scripts:
# Local setup
- &stepLocalSetup
name: Set up local properties and permissons
script: |
chmod +x gradlew
echo "sdk.dir=$HOME/programs/android-sdk-macosx" > "$FCI_BUILD_DIR/local.properties"
# Build DEBUG
- &stepBuildDebug
name: Build Debug
script: ./gradlew buildAllDebug
# Build RELEASE
- &stepBuildRelease
name: Build Release
script: ./gradlew buildAllRelease
# Build PUBLISH
- &stepBuildPublish
name: Build Release and Publish
script: |
./gradlew buildAndPublishRelease
# Flows
workflows:
release-builds:
name: Release builds (master branch only)
scripts:
- name: Check 'master' branch
script: if [ "$FCI_BRANCH" != "master" ]; then exit 1; fi
- *stepLocalSetup
- *stepBuildRelease
publishing:
email:
recipients: *releaseEmails
artifacts: *androidArtifacts
publish-builds:
name: Release and publish builds (master branch only)
environment:
groups:
- mavenCentralPublishing
scripts:
- name: Check 'master' branch
script: if [ "$FCI_BRANCH" != "master" ]; then exit 1; fi
- *stepLocalSetup
- *stepBuildPublish
publishing:
email:
recipients: *releaseEmails
artifacts: *androidArtifacts
develop-builds:
name: Dev builds
triggering:
events:
- push
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: true
scripts:
- *stepLocalSetup
- *stepBuildDebug
artifacts: *androidArtifacts
publishing:
email:
recipients: *debugEmails
merge-requests:
name: Merge requests
triggering:
events:
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: false
cancel_previous_builds: true
scripts:
- *stepLocalSetup
- *stepBuildDebug
publishing:
email:
recipients: *debugEmails
notify:
success: false