Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit d811023

Browse files
committed
Update ghcup to 0.1.8 and add ghc-8.8.4 support
Need to make the apt install function not error whenever it returns a non-zero exit code, because ghc-8.8.4 isn't available via apt just yet
1 parent 34d7e72 commit d811023

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4334,7 +4334,7 @@ function escapeProperty(s) {
43344334
/***/ 447:
43354335
/***/ (function(module) {
43364336

4337-
module.exports = {"ghc":["8.10.1","8.8.3","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"]};
4337+
module.exports = {"ghc":["8.10.1","8.8.4","8.8.3","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"]};
43384338

43394339
/***/ }),
43404340

@@ -11095,7 +11095,10 @@ async function apt(tool, version) {
1109511095
const toolName = tool === 'ghc' ? 'ghc' : 'cabal-install';
1109611096
const v = tool === 'cabal' ? version.slice(0, 3) : version;
1109711097
core.info(`Attempting to install ${toolName} ${v} using apt-get`);
11098-
await exec_1.exec(`sudo -- sh -c "apt-get -y install ${toolName}-${v}"`);
11098+
// Ignore the return code so we can fall back to ghcup
11099+
await exec_1.exec(`sudo -- sh -c "apt-get -y install ${toolName}-${v}"`, undefined, {
11100+
ignoreReturnCode: true
11101+
});
1109911102
}
1110011103
async function choco(tool, version) {
1110111104
core.info(`Attempting to install ${tool} ${version} using chocolatey`);
@@ -11111,7 +11114,7 @@ async function choco(tool, version) {
1111111114
]);
1111211115
}
1111311116
async function ghcupBin(os) {
11114-
const v = '0.1.5';
11117+
const v = '0.1.8';
1111511118
const cachedBin = tc.find('ghcup', v);
1111611119
if (cachedBin)
1111711120
return path_1.join(cachedBin, 'ghcup');

src/installer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ async function apt(tool: Tool, version: string): Promise<void> {
161161
const toolName = tool === 'ghc' ? 'ghc' : 'cabal-install';
162162
const v = tool === 'cabal' ? version.slice(0, 3) : version;
163163
core.info(`Attempting to install ${toolName} ${v} using apt-get`);
164-
await exec(`sudo -- sh -c "apt-get -y install ${toolName}-${v}"`);
164+
// Ignore the return code so we can fall back to ghcup
165+
await exec(`sudo -- sh -c "apt-get -y install ${toolName}-${v}"`, undefined, {
166+
ignoreReturnCode: true
167+
});
165168
}
166169

167170
async function choco(tool: Tool, version: string): Promise<void> {
@@ -180,7 +183,7 @@ async function choco(tool: Tool, version: string): Promise<void> {
180183
}
181184

182185
async function ghcupBin(os: OS): Promise<string> {
183-
const v = '0.1.5';
186+
const v = '0.1.8';
184187
const cachedBin = tc.find('ghcup', v);
185188
if (cachedBin) return join(cachedBin, 'ghcup');
186189

src/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"ghc": [
33
"8.10.1",
4+
"8.8.4",
45
"8.8.3",
56
"8.8.2",
67
"8.8.1",

0 commit comments

Comments
 (0)