feat: make Mapbox SDK authentication optional #465
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android Build | ||
|
Check failure on line 1 in .github/workflows/android-actions.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| env_name: | ||
| required: true | ||
| default: default | ||
| type: string | ||
| ref: | ||
| required: false | ||
| 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 | ||
| secrets: | ||
| MAPBOX_ACCESS_TOKEN: | ||
| required: true | ||
| MAPBOX_DOWNLOAD_TOKEN: | ||
| required: false | ||
| ENV_MAPBOX_ACCESS_TOKEN: | ||
| required: false | ||
| ENV_MAPBOX_DOWNLOAD_TOKEN: | ||
| required: false | ||
| jobs: | ||
| build_example: | ||
| name: Android Example Build ${{ inputs.NEW_ARCH && 'Fabric' || 'Paper' }} ${{ inputs.MAP_IMPL }} | ||
| runs-on: ubuntu-latest | ||
| environment: ${{ inputs.env_name }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| if: ${{ inputs.ref == '' }} | ||
| - name: Checkout fork | ||
| uses: actions/checkout@v4 | ||
| if: ${{ inputs.ref != '' }} | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| - 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' | ||
| # Mapbox download token is no longer required as per Mapbox's removal of authentication requirement | ||
| # See: https://github.com/mapbox/mapbox-maps-flutter/issues/775 | ||
| # Only set if token is provided for backward compatibility | ||
| - run: | | ||
| mkdir -p ~/.gradle/ | ||
| if [ -n "$MAPBOX_DOWNLOAD_TOKEN" ]; then | ||
| echo MAPBOX_DOWNLOADS_TOKEN=$MAPBOX_DOWNLOAD_TOKEN > ~/.gradle/gradle.properties | ||
| fi | ||
| working-directory: example | ||
| env: | ||
| MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN || secrets.ENV_MAPBOX_DOWNLOAD_TOKEN }} | ||
| if: "${{ secrets.MAPBOX_DOWNLOAD_TOKEN || secrets.ENV_MAPBOX_DOWNLOAD_TOKEN }}" | ||
| - run: echo $MAPBOX_ACCESS_TOKEN > ./accesstoken | ||
| 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' }} | ||