docs: rewrite README with full Store options + downloads decision tree #8
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| # `contents: write` is required so the `build-dist` reusable workflow | |
| # (`runsascoded/npm-dist`) can push to the `dist` branch. GH validates | |
| # this at workflow-load time and refuses to schedule with a startup | |
| # failure otherwise. | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build lib | |
| run: pnpm build | |
| - name: Vitest | |
| run: pnpm test | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| build-pages: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build lib (site consumes via link:..) | |
| run: pnpm build | |
| - name: Install site deps | |
| run: pnpm install --frozen-lockfile | |
| working-directory: site | |
| - name: Build site | |
| run: pnpm build | |
| working-directory: site | |
| # SPA fallback for react-router-dom routes (`/mock`, `/http`, …) | |
| - name: SPA fallback | |
| run: cp site/dist/index.html site/dist/404.html | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site/dist | |
| deploy-pages: | |
| needs: build-pages | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 | |
| build-dist: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| uses: runsascoded/npm-dist/.github/workflows/build-dist.yml@v1 | |
| # Default flattening mode: npm-dist copies `dist/`'s contents to the | |
| # dist-branch root and rewrites the `./dist/...` paths in `exports` | |
| # to `./...` to match. We previously used `preserve_dirs: dist` to | |
| # keep paths intact, but v1's merge step transforms paths | |
| # unconditionally on subsequent runs, leaving exports pointing at | |
| # `./index.js` while files still lived under `./dist/index.js` → | |
| # validator failure. Default mode keeps both in sync. | |
| deploy-worker: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build lib (worker consumes via link:../..) | |
| run: pnpm build | |
| - name: Install worker deps | |
| run: pnpm install --frozen-lockfile | |
| working-directory: site/worker | |
| - name: Deploy via wrangler | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| workingDirectory: site/worker | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
| packageManager: pnpm |