[DO NOT MERGE] fix mapbox token issue #1573
This file contains 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: Node CD | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- { os: macos-11, arch: x64 } | |
- { os: ubuntu-latest, arch: x64 } | |
- { os: windows-latest, arch: x64 } | |
- { os: windows-latest, arch: ia32 } | |
variant: | |
- main | |
- icca | |
steps: | |
- name: Context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Use Node.js 14.18.X | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14.18 | |
- name: npm ci | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 5 | |
retry_on: error | |
retry_wait_seconds: 0 | |
command: npm ci | |
env: | |
npm_config_arch: ${{matrix.config.arch}} | |
- name: Lint | |
run: | | |
npm run lint | |
- name: Build frontend | |
run: | | |
npm run build | |
env: | |
CI: true | |
- name: Publish | |
# Currently undocumented, but if it is None or Dependabot (e.g. PR from a fork) then secrets are not defined | |
if: github.secret_source == 'Actions' | |
run: | | |
npm run dist -- --${{matrix.config.arch}} | |
env: | |
ARCH: ${{matrix.config.arch}} | |
CI: true | |
GITHUB_CI_REF: ${{ github.ref }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | |
MAPEO_VARIANT: ${{ matrix.variant }} | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
- name: Publish (unsigned) | |
# Currently undocumented, but if it is None (e.g. PR from a fork) then secrets are not defined | |
if: github.secret_source != 'Actions' | |
run: | | |
npm run dist -- --${{matrix.config.arch}} | |
env: | |
ARCH: ${{matrix.config.arch}} | |
CI: true | |
MAPEO_VARIANT: ${{ matrix.variant }} | |
- name: Cleanup artifacts | |
run: | | |
npx rimraf@2 'dist/${{ matrix.variant }}/!(*.exe|*.deb|*.AppImage|*.dmg|*.yml|*.zip|github)' | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: '${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.variant }}' | |
path: dist/${{ matrix.variant }} |