File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 with :
2020 node-version : ' 21'
2121
22- # Normalize runner.arch to lowercase (same as Go)
23- - name : Normalize runner architecture (Linux/macOS)
24- if : runner.os != 'Windows'
25- shell : bash
26- run : |
27- echo "ARCH=$(echo '${{ runner.arch }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
28-
29- - name : Normalize runner architecture (Windows)
30- if : runner.os == 'Windows'
31- shell : pwsh
32- run : |
33- $arch = "${{ runner.arch }}".ToLower()
34- echo "ARCH=$arch" | Out-File $env:GITHUB_ENV -Append
35-
36- # Detect package-manager and cache location (Node equivalent of `go env`)
37- - name : Set Node cache variables
38- shell : bash
39- run : |
40- const fs = require('fs');
41- const { execSync } = require('child_process');
42-
43- let cache;
44-
45- if (fs.existsSync('pnpm-lock.yaml')) {
46- cache = execSync('pnpm store path').toString().trim();
47- } else if (fs.existsSync('yarn.lock')) {
48- cache = execSync('yarn cache dir').toString().trim();
49- } else {
50- cache = execSync('npm config get cache').toString().trim();
51- }
52-
53- fs.appendFileSync(process.env.GITHUB_ENV, `NODE_CACHE=${cache}\n`);
54-
5522 # Restore Node cache (mirrors Restore Go cache)
5623 - name : Restore Node cache
5724 id : node-cache
You can’t perform that action at this time.
0 commit comments