Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Deploy demo to GitHub Pages

on:
workflow_dispatch:
push:
tags:
- "v*"
workflow_call:

permissions:
id-token: write
Expand All @@ -25,8 +23,6 @@ jobs:
cache: npm
- run: npm ci
- run: npm run build:demo
env:
VITE_MAPTOOLKIT_API_KEY: ${{ secrets.MAPTOOLKIT_API_KEY }}
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
Expand Down
41 changes: 12 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,18 @@ 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
Loading