diff --git a/.github/workflows/update-gl-js.yml b/.github/workflows/update-gl-js.yml new file mode 100644 index 000000000..589a8760c --- /dev/null +++ b/.github/workflows/update-gl-js.yml @@ -0,0 +1,56 @@ +name: update-gl-js + +on: + workflow_dispatch: + inputs: + commit: + description: 'Commit' + required: true + default: '49bc4ca45' + +jobs: + update-gl-js: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: 10 + + - name: Setup git and create branch + run: | + git config --global user.email "mail@example.com" + git config --global user.name "GitHub Action" + git checkout -b update-gl-js-to-${{ github.event.inputs.commit }} + + - name: Checkout MapLibre GL JS + working-directory: maplibre-gl-js + run: | + git checkout ${{ github.event.inputs.commit }} + yarn install + + - name: Generate code for main repo + run: | + npm ci --ignore-scripts + node scripts/generate-shaders.js + + - name: Generate code for iOS + working-directory: platform/ios + run: | + npm install --ignore-scripts + node platform/darwin/scripts/generate-style-code.js + node platform/darwin/scripts/update-examples.js + + - name: Commit and push changes + run: | + git add -u + git commit -m "Update MapLibre GL JS to ${{ github.event.inputs.commit }}" + git push --set-upstream origin update-gl-js-to-${{ github.event.inputs.commit }} + + - name: Create pull request + run: gh pr create --base main --fill + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}