chore(release): version packages #96
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: Quality | |
| on: | |
| schedule: | |
| # 03:00 Asia/Shanghai (UTC+8) | |
| - cron: '0 19 * * *' | |
| pull_request: | |
| paths: | |
| - packages/** | |
| - package.json | |
| - pnpm-lock.yaml | |
| - pnpm-workspace.yaml | |
| - scripts/** | |
| - templates.json | |
| - patches/** | |
| - tsconfig.json | |
| - .github/workflows/hmr-multi-platform.yml | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - packages/** | |
| - package.json | |
| - pnpm-lock.yaml | |
| - pnpm-workspace.yaml | |
| - scripts/** | |
| - templates.json | |
| - patches/** | |
| - tsconfig.json | |
| - .github/workflows/hmr-multi-platform.yml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: quality-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} | |
| jobs: | |
| templates: | |
| name: Resolve templates | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build: ${{ steps.matrix.outputs.build }} | |
| hmr: ${{ steps.matrix.outputs.hmr }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Build matrices | |
| id: matrix | |
| run: | | |
| matrix=$(node scripts/ci-matrix.mjs) | |
| echo "build=$(node -e 'const data=JSON.parse(process.argv[1]); console.log(JSON.stringify(data.build))' "$matrix")" >> "$GITHUB_OUTPUT" | |
| echo "hmr=$(node -e 'const data=JSON.parse(process.argv[1]); console.log(JSON.stringify(data.hmr))' "$matrix")" >> "$GITHUB_OUTPUT" | |
| repository: | |
| name: Repository health | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Validate repository | |
| run: pnpm repo:doctor | |
| - name: Preview release plan | |
| run: pnpm release:status | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint template | |
| run: pnpm lint | |
| cli: | |
| name: Create CLI typecheck and build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Typecheck and build create CLI | |
| run: pnpm create:build | |
| fast-e2e: | |
| name: Fast scaffolding E2E | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browser | |
| run: pnpm --dir packages/create-uni-app-tailwindcss exec playwright install --with-deps chromium | |
| - name: Run fast E2E | |
| run: pnpm test:e2e | |
| - name: Upload fast E2E evidence | |
| if: failure() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: fast-e2e-${{ github.run_id }} | |
| path: | | |
| packages/create-uni-app-tailwindcss/playwright-report | |
| packages/create-uni-app-tailwindcss/test-results | |
| if-no-files-found: warn | |
| retention-days: 7 | |
| build: | |
| name: Build ${{ matrix.template }} / ${{ matrix.target }} | |
| needs: templates | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.templates.outputs.build) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm template ${{ matrix.template }} ${{ matrix.script }} | |
| - name: Verify App CSS compatibility | |
| if: matrix.isDefault && matrix.target == 'app' | |
| run: pnpm template:test ${{ matrix.template }} test:app-css:artifact | |
| - name: Write build evidence | |
| if: always() | |
| shell: bash | |
| run: | | |
| mkdir -p "${{ matrix.source }}/.hmr-artifacts" | |
| output="${{ matrix.source }}/.hmr-artifacts/build-${{ matrix.target }}.txt" | |
| if [[ -d "${{ matrix.source }}/dist/build/${{ matrix.target }}" ]]; then | |
| find "${{ matrix.source }}/dist/build/${{ matrix.target }}" -type f -print | sort > "$output" | |
| else | |
| echo "Missing build output: ${{ matrix.source }}/dist/build/${{ matrix.target }}" > "$output" | |
| fi | |
| - name: Upload build evidence | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: build-${{ matrix.template }}-${{ matrix.target }}-${{ github.run_id }} | |
| path: ${{ matrix.source }}/.hmr-artifacts/build-${{ matrix.target }}.txt | |
| if-no-files-found: error | |
| retention-days: 14 | |
| hmr: | |
| name: HMR ${{ matrix.template }} / ${{ matrix.target }} | |
| needs: templates | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.templates.outputs.hmr) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Tailwind artifact HMR smoke | |
| run: pnpm template:test ${{ matrix.template }} ${{ matrix.script }} -- --timeout 240000 | |
| - name: Upload HMR evidence | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: hmr-${{ matrix.template }}-${{ matrix.target }}-${{ github.run_id }} | |
| path: ${{ matrix.source }}/.hmr-artifacts | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| hmr-h5: | |
| name: H5 runtime HMR | |
| needs: templates | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browser | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Run H5 runtime HMR | |
| run: pnpm test:hmr:h5 -- --timeout 240000 | |
| - name: Upload H5 HMR evidence | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: hmr-h5-${{ github.run_id }} | |
| path: packages/template/.hmr-artifacts | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| workers: | |
| name: H5 Workers dry-run | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build H5 | |
| run: pnpm build:h5 | |
| - name: Verify Workers asset output | |
| run: test -f dist/build/h5/index.html | |
| - name: Validate Workers deployment | |
| run: pnpm workers:check | |
| daily-e2e: | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| name: User journey / ${{ matrix.source }} / Node ${{ matrix.node }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| source: | |
| - candidate | |
| - latest | |
| node: | |
| - 22 | |
| - 24 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browser | |
| run: pnpm --dir packages/create-uni-app-tailwindcss exec playwright install --with-deps chromium | |
| - name: Run generated project lifecycle | |
| run: pnpm test:e2e:daily -- --source ${{ matrix.source }} | |
| - name: Upload generated project lifecycle evidence | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: user-journey-${{ matrix.source }}-node-${{ matrix.node }}-${{ github.run_id }} | |
| path: packages/template/.hmr-artifacts/user-journey/${{ matrix.source }}/node-${{ matrix.node }} | |
| if-no-files-found: error | |
| retention-days: 14 | |
| daily-contract: | |
| if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| name: Daily lifecycle contract | |
| needs: daily-e2e | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Download lifecycle evidence | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| pattern: user-journey-* | |
| path: daily-artifacts | |
| - name: Validate lifecycle coverage and contracts | |
| run: node scripts/validate-daily-contracts.mjs daily-artifacts | |
| - name: Upload contract summary | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: user-journey-contract-${{ github.run_id }} | |
| path: daily-artifacts/daily-contract-summary.md | |
| if-no-files-found: warn | |
| retention-days: 7 | |
| summary: | |
| if: always() | |
| name: Quality summary | |
| needs: | |
| - templates | |
| - repository | |
| - lint | |
| - cli | |
| - fast-e2e | |
| - build | |
| - hmr | |
| - hmr-h5 | |
| - workers | |
| - daily-e2e | |
| - daily-contract | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Write job summary | |
| env: | |
| NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| RESULTS: >- | |
| {"templates":"${{ needs.templates.result }}","repository":"${{ needs.repository.result }}","lint":"${{ needs.lint.result }}","cli":"${{ needs.cli.result }}","fast-e2e":"${{ needs.fast-e2e.result }}","build":"${{ needs.build.result }}","hmr":"${{ needs.hmr.result }}","hmr-h5":"${{ needs.hmr-h5.result }}","workers":"${{ needs.workers.result }}","daily-e2e":"${{ needs.daily-e2e.result }}","daily-contract":"${{ needs.daily-contract.result }}"} | |
| run: | | |
| node <<'NODE' | |
| const fs = require('node:fs') | |
| const results = JSON.parse(process.env.RESULTS) | |
| const nightly = process.env.NIGHTLY === 'true' | |
| const required = new Set(['templates', 'repository', 'lint', 'cli', 'fast-e2e', 'build', 'hmr', 'hmr-h5', 'workers']) | |
| if (nightly) { | |
| required.add('daily-e2e') | |
| required.add('daily-contract') | |
| } | |
| const lines = [ | |
| '# Quality summary', | |
| '', | |
| `Mode: **${nightly ? 'nightly' : 'fast'}**`, | |
| '', | |
| '| Job | Required | Result |', | |
| '| --- | --- | --- |', | |
| ] | |
| for (const [job, result] of Object.entries(results)) { | |
| lines.push(`| ${job} | ${required.has(job) ? 'yes' : 'no'} | ${result} |`) | |
| } | |
| lines.push('', '> External WeChat DevTools, HBuilderX, iOS Simulator, and Android device runtimes are outside hosted CI coverage.', '') | |
| fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `${lines.join('\n')}\n`) | |
| if ([...required].some(job => results[job] !== 'success')) process.exitCode = 1 | |
| NODE |