-
Notifications
You must be signed in to change notification settings - Fork 120
/
config.yml
163 lines (152 loc) · 4.3 KB
/
config.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
version: 2.1
executors:
java-executor:
docker:
- image: mbgl/android-ndk-r21e:f547210689
working_directory: ~/code
environment:
MBX_CI_DOMAIN: o619qyc20d.execute-api.us-east-1.amazonaws.com
workflows:
version: 2
release-workflow:
jobs:
- release:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- publish-documentation:
requires:
- release
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
default:
jobs:
- build
- test
- publish-snapshot:
requires:
- build
- test
filters:
branches:
only:
- main
publish-cli-workflow:
jobs:
- start-publish-cli:
type: approval
- publish-cli:
requires:
- start-publish-cli
commands:
build-release:
steps:
- run:
name: Build libraries
command: make build-release
build-cli:
steps:
- run:
name: Build command line interface
command: make build-cli
- store_artifacts:
path: services-cli/build/libs/services-cli.jar
destination: services-cli.jar
run-tests:
steps:
- run:
name: Check Java code style
command: make checkstyle
- run:
name: Run unit-test for all modules
command: make test
- run:
name: Jacoco test report
command: ./gradlew jacocoTestReport
- store_artifacts:
path: mapbox/app/build/reports
destination: reports
- store_test_results:
path: mapbox/app/build/test-results
- run:
name: Post code coverage report to Codecov.io
command: sh scripts/coverage.sh
setup-aws-credentials:
steps:
- run:
name: Install mbx-ci and obtain credentials
command: |
curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > mbx-ci && chmod 755 ./mbx-ci
./mbx-ci aws setup
jobs:
build:
executor: java-executor
steps:
- checkout
- build-release
- build-cli
test:
executor: java-executor
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}
- run-tests
# ------------------------------------------------------------------------------
publish-snapshot:
executor: java-executor
steps:
- checkout
- setup-aws-credentials
- deploy:
name: Publish Java snapshot libraries to Mapbox SDK Registry
command: |
make sdk-registry-publish-snapshot
release:
executor: java-executor
steps:
- checkout
- build-release
- run-tests
- setup-aws-credentials
- build-cli
- deploy:
name: Upload libraries to Mapbox SDK Registry
command: |
make sdk-registry-upload
- run:
name: Create pull request in api-downloads
command: |
export GITHUB_TOKEN=$(./mbx-ci github writer private token)
git config --global user.email [email protected] && git config --global user.name mapbox-ci
make sdk-registry-publish
publish-documentation:
executor: java-executor
steps:
- checkout
- setup-aws-credentials
- run:
name: Publish API docs
command: |
GITHUB_WRITER_TOKEN=$(./mbx-ci github writer public token)
git remote set-url origin "https://x-access-token:[email protected]/mapbox/mapbox-java.git"
git config --global user.email [email protected] && git config --global user.name mapbox-ci
./scripts/publish_api_docs_android.sh -p $GITHUB_WRITER_TOKEN -t $CIRCLE_TAG
publish-cli:
executor: java-executor
steps:
- checkout
- setup-aws-credentials
- build-cli
- run:
name: 'Upload cli to S3 in: mapbox-java/services-cli.jar'
command: aws s3 cp services-cli/build/libs/services-cli.jar s3://utility-234858372212-us-east-1/mapbox-java/services-cli.jar