refactor: Package structure overhaul (#118) #34
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| run: npm i -g --force corepack@latest && corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| # This expects you to have a script called release which does a build for your packages and calls changeset publish | |
| publish: pnpm release | |
| version: pnpm version | |
| commit: 'chore: release packages' | |
| title: 'chore: release packages' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # Generate preview releases for PRs | |
| - name: Publish Preview Packages | |
| if: steps.changesets.outputs.published != 'true' | |
| run: | | |
| pnpm build:packages | |
| pnpx pkg-pr-new publish \ | |
| ./svelte-maplibre-gl \ | |
| ./extensions/contour \ | |
| ./extensions/deckgl \ | |
| ./extensions/pmtiles \ | |
| ./extensions/terradraw |