11 Commits
v1.1.3 ... main

Author SHA1 Message Date
Andy McKay
59f838c36d Merge pull request #56 from actions/marking-as-unmaintained
Some checks failed
Licensed / Check licenses (push) Has been cancelled
Mark as unmaintained
2020-12-11 13:52:54 -08:00
Andy McKay
a5186f2ae5 Update README.md
Updating as per suggestion.
2020-12-10 16:22:47 -08:00
Andy McKay
6c40c293ec Update README.md
Add in a link to a maintained fork.
2020-11-25 15:07:39 -08:00
Andy McKay
f59ee06298 Update README.md
Add in a notice about the lack of maintenance on this repository. Sadly we haven't got the people to maintain this repository and we'd like to make it clear to visitors to this repository about it's state. This process of marking it unmaintained only affects future updates. The Action will still continue work as it is in old workflows.

Once this lands, we'll also Archive this repository.
2020-11-25 14:08:46 -08:00
Thomas Boop
048c299797 Merge pull request #47 from thboop/main
Update GHC versions on windows
2020-11-18 15:10:47 -05:00
Thomas Boop
8c47402eee Disable commands when choco installing and use old versions 2020-11-18 11:44:19 -05:00
Thomas Boop
7b9c49b13d refactor getChocoPath 2020-11-16 11:40:04 -05:00
Thomas Boop
0ab446a68d get chocoPathVersion Correctly 2020-11-16 11:23:35 -05:00
Thomas Boop
4cd1e346a4 Update readme and correctly add path 2020-11-16 11:13:21 -05:00
Thomas Boop
4861e20f66 Use seperate default version for windows 2020-11-16 10:48:35 -05:00
Thomas Boop
cf5c1bc931 add updated windows versions 2020-11-16 09:31:12 -05:00
3 changed files with 7129 additions and 7078 deletions

View File

@@ -1,5 +1,22 @@
# setup-haskell
**Please note:** This repository is currently unmaintained by a team of developers at GitHub. The
repository is here and you can use it as an example, or in Actions. However please be aware that
we are not going to be updating issues or pull requests on this repository.
**Maintained forks:**
* [haskell/actions](https://github.com/haskell/actions)
You could also fork this code and maintain it, if you do please let us know.
To reflect this state weve marked this repository as Archived.
If you are having an issue or question about GitHub Actions then please [contact customer support](https://help.github.com/en/articles/about-github-actions#contacting-support).
If you have found a security issue [please submit it here](https://hackerone.com/github).
---
[![GitHub Actions status](https://github.com/actions/setup-haskell/workflows/Main%20workflow/badge.svg)](https://github.com/actions/setup-haskell)
This action sets up a Haskell environment for use in actions by:

14155
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -56,14 +56,7 @@ async function isInstalled(
const v = tool === 'cabal' ? version.slice(0, 3) : version;
const aptPath = `/opt/${tool}/${v}/bin`;
const chocoPath = join(
`${process.env.ChocolateyInstall}`,
'lib',
`${tool}.${version}`,
'tools',
`${tool}-${version}`,
tool === 'ghc' ? 'bin' : ''
);
const chocoPath = getChocoPath(tool, version);
const locations = {
stack: [], // Always installed into the tool cache
@@ -169,7 +162,8 @@ async function apt(tool: Tool, version: string): Promise<void> {
async function choco(tool: Tool, version: string): Promise<void> {
core.info(`Attempting to install ${tool} ${version} using chocolatey`);
// Choco tries to invoke `add-path` command on earlier versions of ghc, which has been deprecated and fails the step, so disable command execution during this.
console.log('::stop-commands::SetupHaskellStopCommands');
await exec(
'powershell',
[
@@ -186,6 +180,11 @@ async function choco(tool: Tool, version: string): Promise<void> {
ignoreReturnCode: true
}
);
console.log('::SetupHaskellStopCommands::'); // Re-enable command execution
// Add GHC to path automatically because it does not add until the end of the step and we check the path.
if (tool == 'ghc') {
core.addPath(getChocoPath(tool, version));
}
}
async function ghcupBin(os: OS): Promise<string> {
@@ -214,3 +213,21 @@ async function ghcup(tool: Tool, version: string, os: OS): Promise<void> {
);
if (returnCode === 0 && tool === 'ghc') await exec(bin, ['set', version]);
}
function getChocoPath(tool: Tool, version: string): string {
// 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 === 'ghc' ? `${tool}-${pathVersion}` : `${tool}-${version}`, // choco trims the ghc version here
tool === 'ghc' ? 'bin' : ''
);
return chocoPath;
}