diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fd35eb00..f58bdaa55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,35 @@ on: - main jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + - run: corepack enable + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 22 + cache: pnpm + + - name: 📦 Install dependencies + run: pnpm install + + - name: 🔠 Lint project + run: pnpm lint + + - name: ✂️ Knip project + run: pnpm test:knip + + # - name: ⚙️ Check package engines + # run: pnpm test:engines + ci: strategy: matrix: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} - # permissions: - # id-token: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: @@ -26,26 +48,43 @@ jobs: node-version: 18 cache: pnpm - run: pnpm install - - run: pnpm lint - run: pnpm test:types - run: pnpm build - - run: pnpm knip - run: pnpm test:dist - run: pnpm test:unit - if: matrix.os != 'windows-latest' uses: codecov/codecov-action@v5 + + release: + runs-on: ubuntu-latest + permissions: + id-token: write + if: github.repository_owner == 'nuxt' + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + - run: corepack enable + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 22 + cache: pnpm + + - name: 📦 Install dependencies + run: pnpm install + + - name: 🛠 Build project + run: pnpm build + - name: 📦 release pkg.pr.new - if: github.event_name != 'push' && matrix.os != 'windows-latest' - run: pnpx pkg-pr-new publish --compact --template './playground' + if: github.event_name != 'push' + run: pnpm pkg-pr-new publish --compact --template './playground' + - name: 📦 release nuxi-nightly - if: | - github.event_name == 'push' && - matrix.os != 'windows-latest' && - !contains(github.event.head_commit.message, '[skip-release]') && - !contains(github.event.head_commit.message, 'docs') + if: github.event_name == 'push' run: | echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc && pnpm changelogen --canary nightly --publish env: NPM_TOKEN: ${{secrets.NPM_TOKEN}} - NPM_CONFIG_PROVENANCE: false + NPM_CONFIG_PROVENANCE: true diff --git a/package.json b/package.json index 5ae1751d3..95199f9b1 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "test": "pnpm lint && pnpm test:types && pnpm build && pnpm test:dist", "test:dist": "node ./bin/nuxi.mjs info ./playground", "test:types": "tsc --noEmit", + "test:knip": "knip", "test:unit": "vitest --coverage" }, "devDependencies": {