From 5469967aec3505006d3e6bf1d3ab7d44dbb90703 Mon Sep 17 00:00:00 2001 From: shellscape Date: Wed, 13 Sep 2023 14:51:42 -0400 Subject: [PATCH] chore(repo): update workflows, node and actions versions --- .github/workflows/node-windows.yml | 13 +++++---- .github/workflows/pr-title.yml | 2 -- .github/workflows/release.yml | 40 ++++++++++++++++++++------- .github/workflows/validate.yml | 43 +++++++++++++++++++++++------- .nvmrc | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 +++---- 7 files changed, 79 insertions(+), 33 deletions(-) diff --git a/.github/workflows/node-windows.yml b/.github/workflows/node-windows.yml index be4c65e95..39a740c85 100644 --- a/.github/workflows/node-windows.yml +++ b/.github/workflows/node-windows.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - node: ['18', '16', '14'] + node: ['20', '18'] name: Node v${{ matrix.node }} steps: @@ -25,18 +25,21 @@ jobs: run: git config --global core.autocrlf false - name: Checkout Commit - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Checkout Master run: git branch -f master origin/master - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - name: install pnpm - run: npm install pnpm -g + - name: Enable Corepack + id: pnpm-setup + run: | + corepack enable + corepack prepare pnpm@latest --activate - name: pnpm install run: pnpm install --ignore-scripts diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 95b1f299c..a586f58fe 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -15,8 +15,6 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - name: Check PR Title uses: clowdhaus/actions/pr-title@v0.1.0 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 356731dbc..11ab9a35f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,12 +18,12 @@ jobs: steps: - name: Checkout Commit - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ - name: Checkout Master @@ -31,21 +31,43 @@ jobs: git branch -f master origin/master git checkout master + - name: Enable Corepack + id: pnpm-setup + run: | + corepack enable + corepack prepare pnpm@latest --activate + pnpm config set script-shell "/usr/bin/bash" + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - name: pnpm Cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: ESLint Cache + uses: actions/cache@v3 + with: + path: ./.eslintcache + key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }} + restore-keys: | + ${{ runner.os }}-eslintcache- + - name: Sanity Check run: | + echo git `git version`; echo branch `git branch --show-current`; echo node `node -v`; + echo pnpm `pnpm -v` + echo `moon --version` - name: Initliaze .npmrc run: > echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}\n$(cat .npmrc)" > .npmrc && cat -n .npmrc - - name: Install pnpm - run: | - npm install pnpm -g; - echo node `pnpm -v`; - - name: Set Git Config run: | git config pull.rebase false @@ -54,7 +76,7 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }} - name: pnpm install - run: pnpm install + run: pnpm install --frozen-lockfile - name: Build Packages run: pnpm --recursive build diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 283fc9299..a97dd28b2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,33 +17,56 @@ jobs: strategy: matrix: - node: ['18', '16', '14'] + node: ['20', '18'] name: Node v${{ matrix.node }} steps: - name: Checkout Commit - uses: actions/checkout@v1 + uses: actions/checkout@v4 + + - name: Checkout Master + run: git branch -f master origin/master - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - name: Checkout Master - run: git branch -f master origin/master + - name: Enable Corepack + id: pnpm-setup + run: | + corepack enable + corepack prepare pnpm@latest --activate + pnpm config set script-shell "/usr/bin/bash" + echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + + - name: pnpm Cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - - name: Install pnpm - run: npm install pnpm -g + - name: ESLint Cache + uses: actions/cache@v3 + with: + path: ./.eslintcache + key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }} + restore-keys: | + ${{ runner.os }}-eslintcache- - name: Sanity Check run: | + echo git `git version`; echo branch `git branch --show-current`; - echo node `node --version`; - echo yarn `pnpm --version` + echo node `node -v`; + echo pnpm `pnpm -v` + echo `moon --version` - name: pnpm install - run: pnpm install + run: pnpm install --frozen-lockfile - name: Prettier run: pnpm run prettier:check diff --git a/.nvmrc b/.nvmrc index 8351c1939..209e3ef4b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14 +20 diff --git a/package.json b/package.json index 177b7e3dc..b6203e6d4 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "husky": "8.0.1", "lint-staged": "11.0.1", "nyc": "^15.1.0", - "pnpm": "^7.12.2", + "pnpm": "^8.7.5", "prettier-plugin-package": "^1.3.0", "semver": "^7.3.2", "source-map-support": "^0.5.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 671869676..0db728ed9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,8 +72,8 @@ importers: specifier: ^15.1.0 version: 15.1.0 pnpm: - specifier: ^7.12.2 - version: 7.13.3 + specifier: ^8.7.5 + version: 8.7.5 prettier-plugin-package: specifier: ^1.3.0 version: 1.3.0(prettier@2.8.0) @@ -6273,9 +6273,9 @@ packages: irregular-plurals: 3.3.0 dev: true - /pnpm@7.13.3: - resolution: {integrity: sha512-6avqSfzfAr/9w1ZleaMI276ZuZUu88eOIe6v2mTCuwtSjUEqheboH1G4m7jgF+4arMUfnBrz371UAU+DCeCiSA==} - engines: {node: '>=14.6'} + /pnpm@8.7.5: + resolution: {integrity: sha512-WI8WZb89Uiq5x2jdz4PcQMG9ovTnXcDCEpoEckPYIT2zD8/+dEhVozPlT7bu3WkBgE0uTARtgyIKAFt+IpW2cQ==} + engines: {node: '>=16.14'} hasBin: true dev: true