From 7c81a60833ee6000ba2662c2ebbd2df26a73aa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=B6ck?= Date: Wed, 7 Oct 2026 12:00:12 +0200 Subject: [PATCH 1/3] change workflows to use organization wide workflows to reduce duplicates --- .github/workflows/ci.yml | 25 ++-------- .../{deploy_pages.yaml => deploy-pages.yml} | 4 +- .github/workflows/publish-docs.yml | 23 +++++++++ .github/workflows/release.yml | 50 ++++++++----------- 4 files changed, 50 insertions(+), 52 deletions(-) rename .github/workflows/{deploy_pages.yaml => deploy-pages.yml} (95%) create mode 100644 .github/workflows/publish-docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb3d94f..82d05c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,30 +2,15 @@ name: CI on: push: + branches: [main] pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: - contents: read - jobs: - test: - if: >- - github.event_name != 'pull_request' || - github.event.pull_request.head.repo.full_name != github.repository || - github.event.pull_request.user.login == 'github-actions[bot]' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - run: npm ci - - run: npm run lint - - run: npm run typecheck - - run: npm run test - - run: npm run build + ci: + uses: maptoolkit/.github/.github/workflows/npm-ci.yml@main + permissions: + contents: read diff --git a/.github/workflows/deploy_pages.yaml b/.github/workflows/deploy-pages.yml similarity index 95% rename from .github/workflows/deploy_pages.yaml rename to .github/workflows/deploy-pages.yml index 2b89ad0..2d4bd8f 100644 --- a/.github/workflows/deploy_pages.yaml +++ b/.github/workflows/deploy-pages.yml @@ -2,9 +2,7 @@ name: Deploy demo to GitHub Pages on: workflow_dispatch: - push: - tags: - - "v*" + workflow_call: permissions: id-token: write diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..8a4b82c --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,23 @@ +name: Publish Docs + +on: + workflow_dispatch: + workflow_call: + secrets: + DOCS_REPO_TOKEN: + required: true + +jobs: + publish-docs: + uses: maptoolkit/.github/.github/workflows/publish-docs.yml@main + with: + docs-path: docs/content/third-party-libraries/maplibre/maplibre-style-control.md + front-matter: | + title: "Add a Style Switcher to MapLibre GL JS" + linkTitle: "Style Control" + description: "Let users switch basemap styles in MapLibre GL JS with the Maptoolkit Style Control plugin: install, options, events, and how to keep the map on your keyed styles." + weight: 30 + libraries: [maplibre] + tags: [maplibre, controls, vector] + secrets: + DOCS_REPO_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61eab28..0257266 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,35 +8,27 @@ concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: release: - runs-on: ubuntu-latest + uses: maptoolkit/.github/.github/workflows/npm-release.yml@main permissions: contents: write pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - registry-url: https://registry.npmjs.org - - run: npm ci - - name: Create release PR or publish to npm - uses: changesets/action@v1 - with: - publish: npm run release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Push release tags and create GitHub releases - run: | - tags=$(git tag --points-at HEAD) - if [ -n "$tags" ]; then - git push origin --tags - for tag in $tags; do - gh release create "$tag" --title "$tag" --generate-notes - done - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + deploy-pages: + needs: release + if: needs.release.outputs.published == 'true' + uses: ./.github/workflows/deploy-pages.yml + permissions: + id-token: write + pages: write + contents: read + + publish-docs: + needs: release + if: needs.release.outputs.published == 'true' + uses: ./.github/workflows/publish-docs.yml + permissions: + contents: read + secrets: + DOCS_REPO_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }} From b852c86c8674060d24c5c44f934d174b7bf07f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=B6ck?= Date: Wed, 7 Oct 2026 12:01:43 +0200 Subject: [PATCH 2/3] Update readme with maplibre-gl version and have better badges for maptoolkit docs --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7190862..2aa9e0d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # maplibre-logo-control -[![License](https://img.shields.io/npm/l/@maptoolkit/maplibre-logo-control?style=plastic)](LICENSE) -[![Version](https://img.shields.io/npm/v/@maptoolkit/maplibre-logo-control?style=plastic)](https://www.npmjs.com/package/@maptoolkit/maplibre-logo-control) -[![Downloads](https://img.shields.io/npm/dm/@maptoolkit/maplibre-logo-control?style=plastic)](https://www.npmjs.com/package/@maptoolkit/maplibre-logo-control) +[![NPM](https://img.shields.io/npm/v/@maptoolkit/maplibre-style-control?style=for-the-badge&logo=npm&logoColor=white&labelColor=CB3837&color=555)](https://www.npmjs.com/package/@maptoolkit/maplibre-style-control) +[![License](https://img.shields.io/npm/l/@maptoolkit/maplibre-style-control?style=for-the-badge)](https://github.com/maptoolkit/maplibre-style-control/blob/main/LICENSE) +[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/maptoolkit/maplibre-style-control) A [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) control plugin that adds a maptoolkit logo link to the map. @@ -14,6 +14,8 @@ A [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) control plugin tha npm install @maptoolkit/maplibre-logo-control maplibre-gl ``` +Built and tested against `maplibre-gl` v6. + ## Usage ```js From f80bff2f068f81e04bbf382834a304abe748e597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=B6ck?= Date: Wed, 7 Oct 2026 12:32:11 +0200 Subject: [PATCH 3/3] Update front matter to LogoControl information --- .github/workflows/publish-docs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 8a4b82c..9647c79 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -11,13 +11,13 @@ jobs: publish-docs: uses: maptoolkit/.github/.github/workflows/publish-docs.yml@main with: - docs-path: docs/content/third-party-libraries/maplibre/maplibre-style-control.md + docs-path: docs/content/third-party-libraries/maplibre/maplibre-logo-control.md front-matter: | - title: "Add a Style Switcher to MapLibre GL JS" - linkTitle: "Style Control" - description: "Let users switch basemap styles in MapLibre GL JS with the Maptoolkit Style Control plugin: install, options, events, and how to keep the map on your keyed styles." - weight: 30 + title: "Add the Maptoolkit Logo to MapLibre GL JS" + linkTitle: "Logo Control" + description: "Show the Maptoolkit logo on your MapLibre GL JS map with the Maptoolkit Logo Control plugin: install, usage, and placement." + weight: 40 libraries: [maplibre] - tags: [maplibre, controls, vector] + tags: [maplibre, controls, attribution] secrets: DOCS_REPO_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }}