diff --git a/README.md b/README.md index 1f6cc90..79884f3 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ jobs: ## Version Support -**GHC:** +**GHC on Mac/Ubuntu:** - `latest` (default, recommended) - `8.10.1` `8.10` @@ -141,6 +141,15 @@ jobs: - `8.0.2` `8.0` - `7.10.3` `7.10` +**GHC on Windows:** + +- `latest` (default, recommended) +- `8.10.2.2` +- `8.10.1.1` +- `8.8.4.1` +- `8.8.3.2` +- `8.8.2.1` + Suggestion: Try to support the three latest major versions of GHC. **Cabal:** diff --git a/dist/index.js b/dist/index.js index 18614f0..3761b1b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4291,7 +4291,7 @@ function escapeProperty(s) { /***/ 447: /***/ (function(module) { -module.exports = {"ghc":["8.10.2","8.10.2.2","8.10.1.1","8.10.1","8.8.4.1","8.8.4","8.8.3.2","8.8.3","8.8.2.1","8.8.2","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.3.1","2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]}; +module.exports = {"ghc":["8.10.2","8.10.2.2","8.10.1","8.10.1.1","8.8.4","8.8.4.1","8.8.3","8.8.3.2","8.8.2","8.8.2.1","8.8.1","8.6.5","8.6.4","8.6.3","8.6.2","8.6.1","8.4.4","8.4.3","8.4.2","8.4.1","8.2.2","8.0.2","7.10.3"],"cabal":["3.2.0.0","3.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["2.3.1","2.1.3","2.1.1","1.9.3","1.9.1","1.7.1","1.6.5","1.6.3","1.6.1","1.5.1","1.5.0","1.4.0","1.3.2","1.3.0","1.2.0"]}; /***/ }), @@ -11184,7 +11184,12 @@ async function choco(tool, version) { ignoreReturnCode: true }); // Manually add the path because it won't happen until the end of the step normally - const chocoPath = path_1.join(`${process.env.ChocolateyInstall}`, 'lib', `${tool}.${version}`, 'tools', `${tool}-${version}`, tool === 'ghc' ? 'bin' : ''); + let pathArray = version.split('.'); + let pathVersion = pathArray.length > 3 + ? pathArray.slice(0, pathArray.length - 1).join('.') + : pathArray.join('.'); + const chocoPath = path_1.join(`${process.env.ChocolateyInstall}`, 'lib', `${tool}.${version}`, 'tools', tool === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here + tool === 'ghc' ? 'bin' : ''); core.addPath(chocoPath); } async function ghcupBin(os) { diff --git a/src/installer.ts b/src/installer.ts index dfc78c9..efe8725 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -187,12 +187,17 @@ async function choco(tool: Tool, version: string): Promise { } ); // Manually add the path because it won't happen until the end of the step normally + const pathArray = version.split('.'); + const pathVersion = + pathArray.length > 3 + ? pathArray.slice(0, pathArray.length - 1).join('.') + : pathArray.join('.'); const chocoPath = join( `${process.env.ChocolateyInstall}`, 'lib', `${tool}.${version}`, 'tools', - `${tool}-${version}`, + tool === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here tool === 'ghc' ? 'bin' : '' ); core.addPath(chocoPath); diff --git a/src/versions.json b/src/versions.json index 8116a57..57282fc 100644 --- a/src/versions.json +++ b/src/versions.json @@ -2,14 +2,14 @@ "ghc": [ "8.10.2", "8.10.2.2", - "8.10.1.1", "8.10.1", - "8.8.4.1", + "8.10.1.1", "8.8.4", - "8.8.3.2", + "8.8.4.1", "8.8.3", - "8.8.2.1", + "8.8.3.2", "8.8.2", + "8.8.2.1", "8.8.1", "8.6.5", "8.6.4",