-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbitrise.yml
149 lines (143 loc) · 5.21 KB
/
bitrise.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
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
trigger_map:
- pull_request_target_branch: '*'
workflow: primary
workflows:
primary:
description: |
Runs Linta lint checks unit tests.
steps:
- git-clone@6:
title: Clone GitHub Repository
- cache-pull@2:
title: Pull Cache
- install-missing-android-tools@3:
title: Install Missing Android Tools
inputs:
- gradlew_path: $BITRISE_SOURCE_DIR/gradlew
- gradle-runner@2:
title: Lint Checks
inputs:
- mapping_file_include_filter: '*/lint-results.html'
- gradle_task: '${MODULE_LINTA_ANDROID}:lint'
- gradle-unit-test@1:
title: Linta Android Unit Tests
is_always_run: true
inputs:
- unit_test_task: :${MODULE_LINTA_ANDROID}:test
- codecov@3:
title: Run Codecov
inputs:
- OS: linux
- CODECOV_TOKEN: $CODECOV_TOKEN
- cache-push@2:
title: Push Cache
- deploy-to-bitrise-io@2:
title: Deploy Artifacts to Bitrise
inputs:
- notify_user_groups: none
- permanent_download_url_map_format: |-
| Build Artifacts |
|:-|
{{range $index, $element := .}}{{if $index}}
{{end}}| [{{$element.File}}]({{$element.URL}}) |{{end}}
- comment-on-github-pull-request@0:
title: Comment Bitrise Build Result on the PR
run_if: .IsPR
inputs:
- body: |-
## Bitrise
[View test reports]($BITRISE_BUILD_TEST_REPORTS_URL)
[View more details on Bitrise]($BITRISE_BUILD_URL)
$BITRISE_PERMANENT_DOWNLOAD_URL_MAP
- update_comment_tag: bitrise-build-result
- personal_access_token: $GITHUB_TOKEN
publish-on-maven-central:
description: |
Publish a new version of Linta Android on Maven Central.
steps:
- git-clone@6:
title: Clone GitHub Repository
- cache-pull@2:
title: Pull Cache
- install-missing-android-tools@3:
title: Install Missing Android Tools
inputs:
- gradlew_path: $BITRISE_SOURCE_DIR/gradlew
- gradle-runner@2:
title: Lint Checks
inputs:
- mapping_file_include_filter: '*/lint-results.html'
- gradle_task: '${MODULE_LINTA_ANDROID}:lint'
- gradle-unit-test@1:
title: Linta Android Unit Tests
is_always_run: true
inputs:
- unit_test_task: ':${MODULE_LINTA_ANDROID}:test'
- codecov@3:
title: Run Codecov
inputs:
- OS: linux
- CODECOV_TOKEN: $CODECOV_TOKEN
- script@1:
title: Add Maven Central Secrets
inputs:
- content: |-
# Fail if any commands fails.
set -e
# Add artifact version name.
cat >> $BITRISE_SOURCE_DIR/$MODULE_LINTA_ANDROID/gradle.properties << EOF
VERSION_NAME=$RELEASE_VERSION_NAME
EOF
# Add maven secrets as environment variables.
envman add --key ORG_GRADLE_PROJECT_mavenCentralUsername --value $MAVEN_CENTRAL_USERNAME
envman add --key ORG_GRADLE_PROJECT_mavenCentralPassword --value $MAVEN_CENTRAL_PASSWORD
envman add --key ORG_GRADLE_PROJECT_signingInMemoryKey --value $SIGNING_IN_MEMORY_KEY
envman add --key ORG_GRADLE_PROJECT_signingInMemoryKeyId --value $SIGNING_KEY_ID
envman add --key ORG_GRADLE_PROJECT_signingInMemoryKeyPassword --value $SIGNING_PASSWORD
- gradle-runner@2:
title: Publish Linta Android on Maven Central
inputs:
- gradle_task: publishAllPublicationsToMavenCentral
- github-release@0:
title: Create New Release
inputs:
- username: $GITHUB_USERNAME
- draft: 'no'
- name: $RELEASE_VERSION_NAME
- body: $RELEASE_DESCRIPTION
- tag: $RELEASE_VERSION_NAME
- commit: $GIT_CLONE_COMMIT_HASH
- api_token: $GITHUB_TOKEN
- cache-push@2:
title: Push Cache
- deploy-to-bitrise-io@2:
title: Deploy Artifacts to Bitrise
inputs:
- notify_user_groups: none
- permanent_download_url_map_format: |-
| Build Artifacts |
|:-|
{{range $index, $element := .}}{{if $index}}
{{end}}| [{{$element.File}}]({{$element.URL}}) |{{end}}
meta:
bitrise.io:
stack: linux-docker-android-20.04
app:
envs:
- opts:
is_expand: false
GRADLEW_PATH: ./gradlew
- opts:
is_expand: false
MODULE_LINTA_ANDROID: linta-android
- opts:
is_expand: false
MODULE_SAMPLE: sample
- opts:
is_expand: false
VARIANT_SAMPLE: release
- BITRISE_BUILD_TEST_REPORTS_URL: https://addons-testing.bitrise.io/builds/$BITRISE_BUILD_SLUG