From 8f10afd8c73cc8ced2056bbba6e8dcb8b724f490 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:19:55 +0200 Subject: [PATCH 1/7] Update node version --- .pipelines/pr.yaml | 2 +- .pipelines/publish.yaml | 2 +- .pipelines/templates/build-steps.yaml | 10 +++++----- .pipelines/templates/change-files-steps.yaml | 1 - .pipelines/templates/validate-docs-steps.yaml | 6 +----- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.pipelines/pr.yaml b/.pipelines/pr.yaml index 271ee81fda..592cce69f6 100644 --- a/.pipelines/pr.yaml +++ b/.pipelines/pr.yaml @@ -10,7 +10,7 @@ pr: variables: - name: NodeVersion - value: 20.x + value: 22.x - name: pnpm_config_cache value: $(Pipeline.Workspace)/.pnpm-store diff --git a/.pipelines/publish.yaml b/.pipelines/publish.yaml index 5107c436ab..2c630cb787 100644 --- a/.pipelines/publish.yaml +++ b/.pipelines/publish.yaml @@ -19,7 +19,7 @@ variables: - name: REPO_URL value: github.com/iTwin/viewer-components-react - name: NodeVersion - value: 20.x + value: 22.x - name: pnpm_config_cache value: $(Pipeline.Workspace)/.pnpm-store diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index afa88ab75f..22a7c8f6bc 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -5,6 +5,10 @@ steps: inputs: version: "$(NodeVersion)" + - script: | + npm install -g corepack@0.31.0 + displayName: "Update corepack" + - task: Cache@2 displayName: Cache pnpm inputs: @@ -13,12 +17,8 @@ steps: - script: | corepack enable - corepack prepare pnpm@9.12.3 --activate - displayName: "Setup pnpm" - - - script: | pnpm config set store-dir $(pnpm_config_cache) - displayName: "Setup pnpm config" + displayName: "Setup pnpm" - script: pnpm install --frozen-lockfile displayName: pnpm install diff --git a/.pipelines/templates/change-files-steps.yaml b/.pipelines/templates/change-files-steps.yaml index 88b2713899..38e9a7a3e6 100644 --- a/.pipelines/templates/change-files-steps.yaml +++ b/.pipelines/templates/change-files-steps.yaml @@ -12,7 +12,6 @@ steps: - script: | corepack enable - corepack prepare pnpm@9.12.3 --activate pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" diff --git a/.pipelines/templates/validate-docs-steps.yaml b/.pipelines/templates/validate-docs-steps.yaml index 628a8a57f7..aa8e72a2b8 100644 --- a/.pipelines/templates/validate-docs-steps.yaml +++ b/.pipelines/templates/validate-docs-steps.yaml @@ -12,12 +12,8 @@ steps: - script: | corepack enable - corepack prepare pnpm@9.12.3 --activate - displayName: "Setup pnpm" - - - script: | pnpm config set store-dir $(pnpm_config_cache) - displayName: "Setup pnpm config" + displayName: "Setup pnpm" - script: pnpm install --frozen-lockfile displayName: pnpm install From 568c119f42b1533c95e4a7f4ac04d99c3e1a15f2 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:26:43 +0200 Subject: [PATCH 2/7] Skip corepack integrity check --- .pipelines/templates/build-steps.yaml | 7 +++---- .pipelines/templates/change-files-steps.yaml | 3 +++ .pipelines/templates/validate-docs-steps.yaml | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index 22a7c8f6bc..2b0269dd7a 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -5,10 +5,6 @@ steps: inputs: version: "$(NodeVersion)" - - script: | - npm install -g corepack@0.31.0 - displayName: "Update corepack" - - task: Cache@2 displayName: Cache pnpm inputs: @@ -17,8 +13,11 @@ steps: - script: | corepack enable + corepack install pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" + env: + COREPACK_INTEGRITY_KEYS: 0 - script: pnpm install --frozen-lockfile displayName: pnpm install diff --git a/.pipelines/templates/change-files-steps.yaml b/.pipelines/templates/change-files-steps.yaml index 38e9a7a3e6..213ba11e18 100644 --- a/.pipelines/templates/change-files-steps.yaml +++ b/.pipelines/templates/change-files-steps.yaml @@ -12,8 +12,11 @@ steps: - script: | corepack enable + corepack install pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" + env: + COREPACK_INTEGRITY_KEYS: 0 - script: pnpm install displayName: pnpm install diff --git a/.pipelines/templates/validate-docs-steps.yaml b/.pipelines/templates/validate-docs-steps.yaml index aa8e72a2b8..a1868f6f2f 100644 --- a/.pipelines/templates/validate-docs-steps.yaml +++ b/.pipelines/templates/validate-docs-steps.yaml @@ -12,8 +12,11 @@ steps: - script: | corepack enable + corepack install pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" + env: + COREPACK_INTEGRITY_KEYS: 0 - script: pnpm install --frozen-lockfile displayName: pnpm install From d8c1abd7748f138887ea6b7f68d1ceef0f73c188 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:30:50 +0200 Subject: [PATCH 3/7] Use separate script tasks --- .pipelines/templates/build-steps.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index 2b0269dd7a..c03c4f600f 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -13,12 +13,18 @@ steps: - script: | corepack enable + displayName: "Enable corepack" + + - script: | corepack install - pnpm config set store-dir $(pnpm_config_cache) - displayName: "Setup pnpm" + displayName: "Install pnpm" env: COREPACK_INTEGRITY_KEYS: 0 + - script: | + pnpm config set store-dir $(pnpm_config_cache) + displayName: "Configure pnpm" + - script: pnpm install --frozen-lockfile displayName: pnpm install From 4bf42b39f9b84f2620e19001925ccb8abdc90d2e Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:33:06 +0200 Subject: [PATCH 4/7] Update env --- .pipelines/templates/build-steps.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index c03c4f600f..bc730f472b 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -24,6 +24,8 @@ steps: - script: | pnpm config set store-dir $(pnpm_config_cache) displayName: "Configure pnpm" + env: + COREPACK_INTEGRITY_KEYS: 0 - script: pnpm install --frozen-lockfile displayName: pnpm install From f4f7dc711e4f167ba41b682f123457bf01a56706 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:36:51 +0200 Subject: [PATCH 5/7] Maybe unnecessary? --- .pipelines/templates/build-steps.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index bc730f472b..bf1bb10c6b 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -18,8 +18,6 @@ steps: - script: | corepack install displayName: "Install pnpm" - env: - COREPACK_INTEGRITY_KEYS: 0 - script: | pnpm config set store-dir $(pnpm_config_cache) From 948e4617f49fb0f52057fd7ed9479a534d87b644 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:39:23 +0200 Subject: [PATCH 6/7] Cleanup? --- .pipelines/templates/build-steps.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index bf1bb10c6b..2b0269dd7a 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -13,15 +13,9 @@ steps: - script: | corepack enable - displayName: "Enable corepack" - - - script: | corepack install - displayName: "Install pnpm" - - - script: | pnpm config set store-dir $(pnpm_config_cache) - displayName: "Configure pnpm" + displayName: "Setup pnpm" env: COREPACK_INTEGRITY_KEYS: 0 From 1aededc2b07dbd0bb14339cd9d5688499f4c95a0 Mon Sep 17 00:00:00 2001 From: "Saulius.Skliutas" <24278440+saskliutas@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:42:59 +0200 Subject: [PATCH 7/7] Need to use separate steps --- .pipelines/templates/build-steps.yaml | 4 +++- .pipelines/templates/change-files-steps.yaml | 4 +++- .pipelines/templates/validate-docs-steps.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.pipelines/templates/build-steps.yaml b/.pipelines/templates/build-steps.yaml index 2b0269dd7a..644f10fc4f 100644 --- a/.pipelines/templates/build-steps.yaml +++ b/.pipelines/templates/build-steps.yaml @@ -13,7 +13,9 @@ steps: - script: | corepack enable - corepack install + displayName: "Enable corepack" + + - script: | pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" env: diff --git a/.pipelines/templates/change-files-steps.yaml b/.pipelines/templates/change-files-steps.yaml index 213ba11e18..b69a846c0a 100644 --- a/.pipelines/templates/change-files-steps.yaml +++ b/.pipelines/templates/change-files-steps.yaml @@ -12,7 +12,9 @@ steps: - script: | corepack enable - corepack install + displayName: "Enable corepack" + + - script: | pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" env: diff --git a/.pipelines/templates/validate-docs-steps.yaml b/.pipelines/templates/validate-docs-steps.yaml index a1868f6f2f..b5ac3c9f9e 100644 --- a/.pipelines/templates/validate-docs-steps.yaml +++ b/.pipelines/templates/validate-docs-steps.yaml @@ -12,7 +12,9 @@ steps: - script: | corepack enable - corepack install + displayName: "Enable corepack" + + - script: | pnpm config set store-dir $(pnpm_config_cache) displayName: "Setup pnpm" env: