From ccc03793c84d64ede3b7355c36398106903c6d77 Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Wed, 20 Dec 2023 19:25:13 +0900 Subject: [PATCH] chore: use .node-version Signed-off-by: Mogyuchi --- .github/workflows/ci.yml | 15 +++------------ .node-version | 1 + .npmrc | 2 -- .renovaterc.json | 9 --------- Dockerfile | 3 ++- 5 files changed, 6 insertions(+), 24 deletions(-) create mode 100644 .node-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14de69d3..a193883c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,19 +12,10 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Install pnpm uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0 + - uses: actions/setup-node@v4.0.1 with: - standalone: true - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + cache: "pnpm" + node-version-file: ".node-version" - name: Install dependencies run: pnpm install --frozen-lockfile --strict-peer-dependencies - name: Check types diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..d5a15960 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.10.0 diff --git a/.npmrc b/.npmrc index ca7549b2..7666b20b 100644 --- a/.npmrc +++ b/.npmrc @@ -1,5 +1,3 @@ -use-node-version=20.10.0 - save-exact=true auto-install-peers=true strict-peer-dependencies=true diff --git a/.renovaterc.json b/.renovaterc.json index f07b1a40..3017e0a4 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -15,15 +15,6 @@ ], "dependencyDashboardAutoclose": true, "prConcurrentLimit": 3, - "customManagers": [ - { - "customType": "regex", - "fileMatch": ["(^|/)\\.npmrc$"], - "matchStrings": ["use-node-version=(?.*?)\\n"], - "depNameTemplate": "node", - "datasourceTemplate": "node-version" - } - ], "packageRules": [ { "matchDepTypes": ["dependencies", "require"], diff --git a/Dockerfile b/Dockerfile index 4961340f..cba92fa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,8 @@ ENV PATH="$PNPM_HOME:$PATH" WORKDIR /package COPY --link --from=fetch-pnpm /pnpm/ /pnpm/ RUN pnpm config set store-dir /.pnpm-store -COPY --link .npmrc ./ +COPY --link .npmrc .node-version ./ +RUN echo "use-node-version=`cat .node-version`" >> .npmrc RUN --mount=type=cache,target=/.pnpm-store \ # package.json: for simple-git-hooks --mount=type=bind,source=package.json,target=package.json \