File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,24 +172,38 @@ jobs:
172172 git config --global core.eol lf
173173 shell : bash
174174
175- - name : Check if fnm is installed
176- id : check-fnm
177- run : |
178- if [ -x "$(command -v fnm)" ]; then
179- echo "fnm found."
180- echo "found=true" >> $GITHUB_OUTPUT
181- else
182- echo "fnm not found."
183- echo "found=false" >> $GITHUB_OUTPUT
184- fi
185-
186175 - name : Install fnm
187- if : steps.check-fnm.outputs.found != 'true'
188176 run : |
189- export FNM_DIR="${HOME}/.local/share/fnm"
190- curl -fsSL https://fnm.vercel.app/install | bash
177+ FNM_VERSION=v1.39.0
178+ FNM_DIR="$HOME/.local/share/fnm"
179+
180+ case "$RUNNER_OS" in
181+ Linux)
182+ FNM_ASSET=fnm-linux.zip
183+ FNM_SHA256=7807664f39d39fc518da1c35ba0181e4b3267603c4b1dedeb4b5fc6ae440a224
184+ FNM_EXE=fnm
185+ ;;
186+ Windows)
187+ FNM_ASSET=fnm-windows.zip
188+ FNM_SHA256=8183bed4348cb78fdfd8abb3d1247fbeab7b2082f941363929c61e747c001e10
189+ FNM_EXE=fnm.exe
190+ ;;
191+ *)
192+ echo "::error::Unsupported RUNNER_OS: $RUNNER_OS"
193+ exit 1
194+ ;;
195+ esac
196+ FNM_BIN="$FNM_DIR/$FNM_EXE"
191197 export PATH="$FNM_DIR:$PATH"
192198 echo "$FNM_DIR" >> $GITHUB_PATH
199+
200+ curl -L --fail --retry 3 -o /tmp/fnm.zip \
201+ "https://github.com/Schniz/fnm/releases/download/$FNM_VERSION/$FNM_ASSET"
202+ echo "$FNM_SHA256 /tmp/fnm.zip" | sha256sum --check --status
203+ unzip /tmp/fnm.zip "$FNM_EXE" -d "$FNM_DIR"
204+ rm /tmp/fnm.zip
205+ chmod +x "$FNM_BIN"
206+
193207 fnm env --json | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' | xargs -I {} echo "{}" >> $GITHUB_ENV
194208
195209 - name : Normalize input step names into path key
You can’t perform that action at this time.
0 commit comments