Skip to content

Commit 77ac4d4

Browse files
committed
add bitrise CI script
1 parent f7e6625 commit 77ac4d4

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

scripts/bitrise.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
format_version: 1.0.0
3+
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
4+
trigger_map:
5+
- pattern: scheduled
6+
workflow: scheduled
7+
- pattern: "*"
8+
workflow: primary
9+
workflows:
10+
primary:
11+
steps:
12+
- script:
13+
title: Check for skipping CI
14+
inputs:
15+
- content: |-
16+
#!/bin/bash
17+
if [[ -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[skip ci\]/p')" ||
18+
-n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[ci skip\]/p')" ||
19+
-n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY | sed -n 's/\[skip ci\]/p')" ||
20+
-n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY | sed -n 's/\[ci skip\]/p')" ]]; then
21+
envman add --key SKIPCI --value true
22+
else
23+
envman add --key SKIPCI --value false
24+
fi
25+
- script:
26+
title: Build Android SDK
27+
inputs:
28+
- content: |-
29+
#!/bin/bash
30+
cd libjava; ./gradlew assembleRelease
31+
cd libandroid; ./gradlew assembleRelease
32+
- is_debug: 'yes'
33+
- script:
34+
title: Run Unit Tests
35+
inputs:
36+
- content: |-
37+
#!/bin/bash
38+
cd libjava; ./gradlew testReleaseUnitTest --continue
39+
cd libandroid; ./gradlew testReleaseUnitTest --continue
40+
- is_debug: 'yes'
41+
- slack:
42+
title: Post to Slack
43+
run_if: '{{enveq "SKIPCI" "false"}}'
44+
inputs:
45+
- webhook_url: "$SLACK_HOOK_URL"
46+
- channel: "#gl-bots"
47+
- from_username: 'Bitrise Android'
48+
- from_username_on_error: 'Bitrise Android'
49+
- message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
50+
for <https://github.com/mapbox/mapbox-java/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-java@${BITRISE_GIT_BRANCH}>
51+
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
52+
passed'
53+
- message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
54+
for <https://github.com/mapbox/mapbox-java/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-java@${BITRISE_GIT_BRANCH}>
55+
by ${GIT_CLONE_COMMIT_COMMITER_NAME}
56+
failed'
57+
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
58+
- icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png
59+
scheduled:
60+
steps:
61+
- script:
62+
title: Install Linux Dependencies
63+
inputs:
64+
- content: |-
65+
#!/bin/bash
66+
apt-get install -y pkg-config python-pip python-dev build-essential
67+
pip install awscli
68+
- script:
69+
title: Fetch GPG Secring For SDK Signing
70+
inputs:
71+
- content: |-
72+
#!/bin/bash
73+
aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg secring.gpg
74+
opts:
75+
is_expand: true
76+
- script:
77+
title: Inject Signing And Publishing Credentials
78+
inputs:
79+
- content: |-
80+
#!/bin/bash
81+
echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME
82+
NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD
83+
signing.keyId=$SIGNING_KEYID
84+
signing.password=$SIGNING_PASSWORD
85+
signing.secretKeyRingFile=../../secring.gpg" >> libjava/gradle.properties
86+
87+
echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME
88+
NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD
89+
signing.keyId=$SIGNING_KEYID
90+
signing.password=$SIGNING_PASSWORD
91+
signing.secretKeyRingFile=../../secring.gpg" >> libandroid/gradle.properties
92+
opts:
93+
is_expand: true
94+
- script:
95+
title: Build Android SDK
96+
inputs:
97+
- content: |-
98+
#!/bin/bash
99+
cd libjava; ./gradlew assembleRelease
100+
cd libandroid; ./gradlew assembleRelease
101+
- script:
102+
title: Run Unit Tests
103+
inputs:
104+
- content: |-
105+
#!/bin/bash
106+
cd libjava; ./gradlew testReleaseUnitTest --continue
107+
cd libandroid; ./gradlew testReleaseUnitTest --continue
108+
- script:
109+
title: Publish To Maven Central
110+
inputs:
111+
- content: |-
112+
#!/bin/bash
113+
cd libjava; ./gradlew uploadArchives
114+
cd libandroid; ./gradlew uploadArchives

0 commit comments

Comments
 (0)