diff --git a/.github/workflows/module.yml b/.github/workflows/module.yml index d7fb594243..8ce394f2e0 100644 --- a/.github/workflows/module.yml +++ b/.github/workflows/module.yml @@ -8,6 +8,12 @@ on: branches: - v4 +concurrency: + # Group pull request runs per number so a new push cancels the previous one, and give every push on v4 + # its own group since each of them also covers windows and publishes its own preview package + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: runs-on: ${{ matrix.os }} @@ -19,7 +25,7 @@ jobs: strategy: matrix: os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "windows-latest"]') }} # macos-latest - node: [22] + node: [24] env: NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }} @@ -27,6 +33,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + persist-credentials: false - name: Install pnpm uses: pnpm/action-setup@v6 @@ -43,23 +51,22 @@ jobs: - name: Prepare run: pnpm run dev:prepare - - name: Lint - run: pnpm run lint - - - name: Typecheck - run: pnpm run typecheck - - - name: Test - run: pnpm run test run + - parallel: + - name: Lint + run: pnpm run lint + - name: Typecheck + run: pnpm run typecheck + - name: Test + run: pnpm run test run - name: Build run: pnpm run build - - name: Build Nuxt playground - run: pnpm run dev:build - - - name: Build Vue playground - run: pnpm run dev:vue:build + - parallel: + - name: Build Nuxt playground + run: pnpm run dev:build + - name: Build Vue playground + run: pnpm run dev:vue:build - name: Publish # Only publish preview package on ubuntu, and skip forks of the repo (pkg-pr-new still runs on fork PRs against nuxt/ui) @@ -86,11 +93,13 @@ jobs: strategy: matrix: os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] + node: [24] steps: - name: Checkout uses: actions/checkout@v7 + with: + persist-credentials: false - name: Store commit SHA run: | @@ -117,52 +126,7 @@ jobs: - name: Typecheck run: pnpm run typecheck - starter: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/starter - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - starter-vue: + templates: needs: build runs-on: ${{ matrix.os }} @@ -172,15 +136,35 @@ jobs: pull-requests: read strategy: + # Keep validating every template when one of them breaks + fail-fast: false matrix: os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] + node: [24] + template: + - starter + - starter-vue + - landing + - docs + - saas + - dashboard + - dashboard-vue + - chat + - chat-vue + - portfolio + - changelog + - editor + include: + # Build with vite directly since the `build` script also runs the database migrations + - template: chat-vue + build: pnpm vite build steps: - name: Checkout uses: actions/checkout@v7 with: - repository: nuxt-ui-templates/starter-vue + persist-credentials: false + repository: nuxt-ui-templates/${{ matrix.template }} - name: Store commit SHA run: | @@ -202,412 +186,7 @@ jobs: run: pnpm install - name: Build - run: pnpm run build - - - name: Typecheck - run: pnpm run typecheck - - landing: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/landing - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install + run: ${{ matrix.build || 'pnpm run build' }} - name: Typecheck run: pnpm run typecheck - - - name: Build - run: pnpm run build - - docs: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/docs - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - saas: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/saas - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - dashboard: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/dashboard - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - dashboard-vue: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/dashboard-vue - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Build - run: pnpm run build - - - name: Typecheck - run: pnpm run typecheck - - chat: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/chat - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - portfolio: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/portfolio - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - changelog: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/changelog - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build - - editor: - needs: build - - runs-on: ${{ matrix.os }} - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] - - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - repository: nuxt-ui-templates/editor - - - name: Store commit SHA - run: | - echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV - - - name: Install pnpm - uses: pnpm/action-setup@v6 - - - name: Install node - uses: actions/setup-node@v7 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install latest nuxt/ui - run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only - - - name: Install dependencies - run: pnpm install - - - name: Typecheck - run: pnpm run typecheck - - - name: Build - run: pnpm run build diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index f575c56188..13097449d9 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -5,7 +5,7 @@ on: jobs: labeler: - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b073522fa..2c331c6a58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,13 @@ jobs: publish: runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: matrix: os: [ubuntu-latest] # macos-latest, windows-latest - node: [22] + node: [24] env: NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }} @@ -20,6 +23,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + persist-credentials: false - name: Install pnpm uses: pnpm/action-setup@v6 @@ -36,14 +41,13 @@ jobs: - name: Prepare run: pnpm run dev:prepare - - name: Lint - run: pnpm run lint - - - name: Typecheck - run: pnpm run typecheck - - - name: Test - run: pnpm run test run + - parallel: + - name: Lint + run: pnpm run lint + - name: Typecheck + run: pnpm run typecheck + - name: Test + run: pnpm run test run - name: Publish run: ./scripts/release.sh diff --git a/.github/workflows/reproduction.yml b/.github/workflows/reproduction.yml index 41b077e183..9748812ba5 100644 --- a/.github/workflows/reproduction.yml +++ b/.github/workflows/reproduction.yml @@ -7,7 +7,7 @@ on: jobs: reproduction: - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: actions: write diff --git a/.github/workflows/reproduire.yml b/.github/workflows/reproduire.yml index f71328e8ab..3838291977 100644 --- a/.github/workflows/reproduire.yml +++ b/.github/workflows/reproduire.yml @@ -5,13 +5,16 @@ on: types: [labeled] permissions: + contents: read issues: write jobs: reproduire: - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v7 + with: + persist-credentials: false - uses: Hebilicious/reproduire@4b686ae9cbb72dad60f001d278b6e3b2ce40a9ac # v0.0.9 with: label: needs reproduction diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index f76c5fd77f..f2a950c376 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,7 +7,7 @@ on: jobs: stale: - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: actions: write