From b4503033f04442557e39c740cfa6d732e5997f7d Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Thu, 1 May 2025 14:08:44 +0000 Subject: [PATCH 1/4] Fix Windows build job in CI workflow --- .github/workflows/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a88146..58b4a1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} + # Adding a comment to clarify the purpose of the Windows build job build-on-windows: strategy: matrix: @@ -34,7 +35,11 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - # https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc + # Ensure PowerShell execution policy is unrestricted for npm upgrade + - name: Set PowerShell Execution Policy + run: | + Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force + shell: pwsh - run: | npm install npm-windows-upgrade --location=global npm-windows-upgrade --npm-version latest @@ -85,6 +90,10 @@ jobs: with: node-version: ${{ matrix.node }} # https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc + - name: Set PowerShell Execution Policy + run: | + Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force + shell: pwsh - run: | npm install npm-windows-upgrade --location=global npm-windows-upgrade --npm-version latest From 9aaec722be8bf840e0469a81c605df43115dfaae Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Fri, 2 May 2025 00:21:34 +0000 Subject: [PATCH 2/4] fix: Specify PowerShell for npm-windows-upgrade command execution in Windows environment --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58b4a1d..3b46338 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,6 +97,7 @@ jobs: - run: | npm install npm-windows-upgrade --location=global npm-windows-upgrade --npm-version latest + shell: pwsh - uses: ./ with: github_token: ${{ secrets.GITHUB_TOKEN }} From f8f995f645df9d674a2a48a81cd70be7c288e5bf Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Fri, 2 May 2025 00:28:06 +0000 Subject: [PATCH 3/4] fix: Combine PowerShell execution policy setting with npm-windows-upgrade step --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b46338..b256376 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,11 +90,8 @@ jobs: with: node-version: ${{ matrix.node }} # https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc - - name: Set PowerShell Execution Policy - run: | - Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force - shell: pwsh - run: | + Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install npm-windows-upgrade --location=global npm-windows-upgrade --npm-version latest shell: pwsh From 05ae6e9b0316cd073a17d398a749bf3e5280f866 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Fri, 2 May 2025 00:39:05 +0000 Subject: [PATCH 4/4] Remove npm-windows-upgrade steps as they are no longer needed with Node.js 20 --- .github/workflows/test.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b256376..ad177af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,14 +35,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - # Ensure PowerShell execution policy is unrestricted for npm upgrade - - name: Set PowerShell Execution Policy - run: | - Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force - shell: pwsh - - run: | - npm install npm-windows-upgrade --location=global - npm-windows-upgrade --npm-version latest + # Node.js 20 already includes a recent npm version, so npm upgrade is not needed - run: | npm ci npm run all @@ -89,12 +82,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - # https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc - - run: | - Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force - npm install npm-windows-upgrade --location=global - npm-windows-upgrade --npm-version latest - shell: pwsh + # Node.js 20 already includes a recent npm version, so npm upgrade is not needed - uses: ./ with: github_token: ${{ secrets.GITHUB_TOKEN }}