Skip to content

Commit 93d014b

Browse files
committed
Convert CircleCI build job to GHA
1 parent 2fb9341 commit 93d014b

2 files changed

Lines changed: 76 additions & 14 deletions

File tree

.github/workflows/main.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ '**' ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
container:
13+
image: mbgl/android-sdk:latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Check code style
19+
run: make checkstyle
20+
21+
- name: Run Lint
22+
run: ./gradlew lint
23+
24+
- name: Run unit-test in Android libraries
25+
run: make test
26+
27+
- name: Upload reports
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: reports
31+
path: app/build/reports
32+
33+
- name: Upload test results
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: test-results
37+
path: app/build/test-results
38+
39+
# release:
40+
# runs-on: ubuntu-latest
41+
# container:
42+
# image: mbgl/android-ndk-r21e:latest
43+
# if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
44+
# steps:
45+
# - uses: actions/checkout@v3
46+
#
47+
# - name: Init aws with mbx-ci
48+
# run: |
49+
# curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > mbx-ci && chmod 755 ./mbx-ci
50+
# ./mbx-ci aws setup
51+
#
52+
# - name: Update version name
53+
# run: |
54+
# if [[ $GITHUB_REF == refs/tags/v* ]]; then
55+
# VERSION_NAME=${GITHUB_REF#refs/tags/v}
56+
# sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${VERSION_NAME}/" library/gradle.properties
57+
# elif [[ $GITHUB_REF == refs/heads/master ]]; then
58+
# COMMIT_SHA=$(git rev-parse --short HEAD)
59+
# sed -i -e "s/-SNAPSHOT.*/-${COMMIT_SHA}-SNAPSHOT/" library/gradle.properties
60+
# fi
61+
#
62+
# - name: Build libraries
63+
# run: make release
64+
#
65+
# - name: Publish to the SDK registry
66+
# env:
67+
# GITHUB_TOKEN: ${{ secrets.SDK_REGISTRY_TOKEN }}
68+
# run: |
69+
# git config --global user.email "MapboxCI@users.noreply.github.com"
70+
# git config --global user.name "MapboxCI"
71+
# if [[ $GITHUB_REF == refs/heads/master ]] || [[ $GITHUB_REF == refs/tags/v* ]]; then
72+
# make sdkRegistryUpload
73+
# fi
74+
# if [[ $GITHUB_REF == refs/tags/v* ]]; then
75+
# make sdkRegistryPublish
76+
# fi

build.gradle

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ buildscript {
55
mavenCentral()
66
maven {
77
url 'https://api.mapbox.com/downloads/v2/releases/maven'
8-
authentication {
9-
basic(BasicAuthentication)
10-
}
11-
credentials {
12-
username = "mapbox"
13-
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
14-
}
158
}
169
}
1710
dependencies {
@@ -28,13 +21,6 @@ allprojects {
2821
mavenCentral()
2922
maven {
3023
url 'https://api.mapbox.com/downloads/v2/releases/maven'
31-
authentication {
32-
basic(BasicAuthentication)
33-
}
34-
credentials {
35-
username = "mapbox"
36-
password = password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
37-
}
3824
}
3925
}
4026
}

0 commit comments

Comments
 (0)