feat: add CLI commands and improve migrations DX #1597
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 | |
| - v1 | |
| pull_request: | |
| branches: | |
| - main | |
| - v1 | |
| permissions: | |
| id-token: write | |
| # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml | |
| env: | |
| # 7 GiB by default on GitHub, setting to 6 GiB | |
| # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| # install playwright binary manually (because pnpm only runs install script once) | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.sha }} | |
| cancel-in-progress: ${{ github.event_name != 'push' }} | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: npm i -g --force corepack && corepack enable | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Lint | |
| run: pnpm lint | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| # os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: npm i -g --force corepack && corepack enable | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org/" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Prepare environment | |
| run: pnpm dev:prepare | |
| - name: Run test suite | |
| run: pnpm test | |
| # - name: Run types tests | |
| # run: pnpm test:types | |
| publish: | |
| needs: [lint, test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - run: npm i -g --force corepack && corepack enable | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org/" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Prepare environment | |
| run: pnpm dev:prepare | |
| - name: Build package | |
| run: pnpm prepack | |
| - name: Publish | |
| run: pnpx pkg-pr-new publish --compact --no-template --pnpm |