Repository navigation
85 lines (75 loc) · 2.47 KB
/
Copy pathandroid-actions.yml
File metadata and controls
85 lines (75 loc) · 2.47 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
name: Android Build
on:
workflow_call:
inputs:
env_name:
required: true
default: default
type: string
NVMRC:
required: true
type: string
MAP_IMPL:
description: "The map implementation to use (mapbox,mapbox11)"
default: mapbox
required: false
type: string
NEW_ARCH:
description: "If build with new architecture or not"
default: false
required: false
type: boolean
SKIP:
description: "Report the build as skipped, e.g. when only the web implementation changed"
default: false
required: false
type: boolean
secrets:
MAPBOX_ACCESS_TOKEN:
required: true
ENV_MAPBOX_ACCESS_TOKEN:
required: false
jobs:
report_skipped_build:
name: Android Example Build ${{ inputs.NEW_ARCH && 'Fabric' || 'Paper' }} ${{ inputs.MAP_IMPL }}
if: ${{ inputs.SKIP }}
runs-on: ubuntu-latest
steps:
- run: echo "Only src/web changed, so the Android build is not needed"
build_example:
name: Android Example Build ${{ inputs.NEW_ARCH && 'Fabric' || 'Paper' }} ${{ inputs.MAP_IMPL }}
if: ${{ !inputs.SKIP }}
runs-on: ubuntu-latest
environment: ${{ inputs.env_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node ${{ inputs.NVMRC }}
uses: actions/setup-node@v3.5.1
with:
node-version: ${{ inputs.NVMRC }}
- name: Setup JDK zulu 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
# Fork PRs get no secrets; fall back to the public rotated CI token (see rnmapbox/ci-config)
- name: Access token
run: |
if [ -n "$MAPBOX_ACCESS_TOKEN" ]; then
echo "$MAPBOX_ACCESS_TOKEN" > ./accesstoken
else
"$GITHUB_WORKSPACE/scripts/ci/fetch-mapbox-token.sh" > ./accesstoken
fi
working-directory: example
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN || secrets.ENV_MAPBOX_ACCESS_TOKEN }}
- run: yarn install --network-timeout 1000000
working-directory: example
- run: yarn postinstall
working-directory: example
- run: ./gradlew assemble
working-directory: example/android
env:
CI_MAP_IMPL: ${{ inputs.MAP_IMPL }}
ORG_GRADLE_PROJECT_newArchEnabled: ${{ inputs.NEW_ARCH && 'true' || 'false' }}