diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18dd78bc..17b52637 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,14 @@ name: CI on: - push: - branches: - - main - pull_request: + push: + branches: + - main + pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true jobs: # TODO: Readd this once we get the types fine for Svelte 5 @@ -16,15 +16,13 @@ jobs: # name: Run svelte-check # runs-on: ubuntu-latest # steps: - # - uses: actions/checkout@v3 - # with: - # fetch-depth: 0 + # - uses: actions/checkout@v4 - # - uses: pnpm/action-setup@v2 + # - uses: pnpm/action-setup@v3 # with: # version: 8 - # - uses: actions/setup-node@v3 + # - uses: actions/setup-node@v4 # with: # node-version: 18 @@ -34,7 +32,7 @@ jobs: # run: | # echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT # - name: Setup pnpm cache - # uses: actions/cache@v3 + # uses: actions/cache@v4 # with: # path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} @@ -53,77 +51,73 @@ jobs: # - name: Run svelte-check # run: pnpm check - Test: - runs-on: ubuntu-latest - name: Test - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Node.JS - uses: actions/setup-node@v3 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8 - - # PNPM Store cache setup - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install - - - run: pnpm test + Test: + runs-on: ubuntu-latest + name: Test + steps: + - uses: actions/checkout@v4 + + - name: Install Node.JS + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v3 + name: Install pnpm + id: pnpm-install + with: + version: 8 + + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - run: pnpm test - Lint: - runs-on: ubuntu-latest - name: Lint - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Node.JS - uses: actions/setup-node@v3 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8 - - # PNPM Store cache setup - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install - - - run: pnpm lint + Lint: + runs-on: ubuntu-latest + name: Lint + steps: + - uses: actions/checkout@v4 + + - name: Install Node.JS + uses: actions/setup-node@v4 + with: + node-version: 18 + + - uses: pnpm/action-setup@v3 + name: Install pnpm + id: pnpm-install + with: + version: 8 + + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - run: pnpm lint diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index 2e89081d..aaa80506 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -34,14 +34,14 @@ jobs: runs-on: ubuntu-latest name: Deploy Preview to Cloudflare Pages (admin) steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v3 with: version: 8 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 @@ -51,7 +51,7 @@ jobs: run: | echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Setup pnpm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} diff --git a/.github/workflows/docs-production.yml b/.github/workflows/docs-production.yml index 0c179c52..3371ee04 100644 --- a/.github/workflows/docs-production.yml +++ b/.github/workflows/docs-production.yml @@ -17,11 +17,11 @@ jobs: deployments: write name: Publish to Cloudflare Pages steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 with: version: 8 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 @@ -31,7 +31,7 @@ jobs: run: | echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Setup pnpm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c6001ef..feece016 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,43 +1,57 @@ name: Release on: - push: - branches: - - main + push: + branches: + - main concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: - release: - permissions: - contents: write # to create release (changesets/action) - pull-requests: write # to create pull request (changesets/action) - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits - fetch-depth: 0 - - uses: pnpm/action-setup@v2.2.4 - with: - version: 8.6.3 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "18.x" - cache: pnpm - - - run: pnpm install --frozen-lockfile - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - commit: "chore(release): version package" - title: "chore(release): version package" - publish: pnpm ci:publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + release: + permissions: + contents: write # to create release (changesets/action) + pull-requests: write # to create pull request (changesets/action) + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - run: pnpm install --frozen-lockfile + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + commit: "chore(release): version package" + title: "chore(release): version package" + publish: pnpm ci:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}