Module

GitHub.Actions.ToolCache

Exports functions from the @actions/tool-cache module provided by GitHub https://github.com/actions/toolkit/tree/main/packages/tool-cache

#downloadTool

downloadTool :: DownloadToolArgs -> ExceptT Error Aff FilePath

Download a tool from an url and stream it into a file

#downloadTool'

downloadTool' :: String -> ExceptT Error Aff FilePath

Download a tool from an url and stream it into a file

#DownloadToolArgs

type DownloadToolArgs = { auth :: Maybe String, dest :: Maybe FilePath, url :: String }

url: url of tool to download dest: path to download tool. Defaults to randomly generated path auth: authorization header

#extract7z

extract7z :: Extract7zArgs -> ExceptT Error Aff FilePath

Extract a .7z file. Returns path to the destination directory

#extract7z'

extract7z' :: FilePath -> ExceptT Error Aff FilePath

Extract a .7z file. Returns path to the destination directory

#Extract7zArgs

type Extract7zArgs = { _7zPath :: Maybe FilePath, dest :: Maybe FilePath, file :: FilePath }

file: path to the .7z file dest: destination directory. Optional. _7zPath: path to 7zr.exe. Optional, for long path support.

#extractTar

extractTar :: ExtractTarArgs -> ExceptT Error Aff FilePath

Extract a compressed tar archive. Returns path to the destination directory

#extractTar'

extractTar' :: FilePath -> ExceptT Error Aff FilePath

Extract a compressed tar archive. Returns path to the destination directory

#ExtractTarArgs

type ExtractTarArgs = { dest :: Maybe FilePath, file :: FilePath, flags :: Maybe (Array String) }

file: path to the tar dest: destination directory. Defaults to randomly generated path flags: flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars).

#extractXar

extractXar :: ExtractXarArgs -> ExceptT Error Aff FilePath

Extract a xar compatible archive. Returns path to the destination directory

#extractXar'

extractXar' :: FilePath -> ExceptT Error Aff FilePath

Extract a xar compatible archive. Returns path to the destination directory

#ExtractXarArgs

type ExtractXarArgs = { dest :: Maybe FilePath, file :: FilePath, flags :: Maybe (Array String) }

file: path to the archive dest: destination directory. Defaults to randomly generated path flags: flags for the xar

#extractZip

extractZip :: ExtractZipArgs -> ExceptT Error Aff FilePath

Extract a zip. Returns path to the destination directory

#extractZip'

extractZip' :: FilePath -> ExceptT Error Aff FilePath

Extract a zip. Returns path to the destination directory

#ExtractZipArgs

type ExtractZipArgs = { dest :: Maybe FilePath, file :: FilePath }

file: path to the zip dest: destination directory. Defaults to randomly generated path

#cacheDir

cacheDir :: CacheDirArgs -> ExceptT Error Aff FilePath

Caches a directory and installs it into the tool cacheDir

#cacheDir'

cacheDir' :: { sourceDir :: String, tool :: String, version :: String } -> ExceptT Error Aff FilePath

Caches a directory and installs it into the tool cacheDir

#CacheDirArgs

type CacheDirArgs = { arch :: Maybe String, sourceDir :: String, tool :: String, version :: String }

sourceDir: the directory to cache into tools tool: tool name version: version of the tool. semver format architecture of the tool. Defaults to machine architecture

#cacheFile

cacheFile :: CacheFileArgs -> ExceptT Error Aff FilePath

Caches a downloaded file (GUID) and installs it into the tool cache with a given targetName

#cacheFile'

cacheFile' :: { sourceFile :: FilePath, targetFile :: FilePath, tool :: String, version :: String } -> ExceptT Error Aff FilePath

Caches a downloaded file (GUID) and installs it into the tool cache with a given targetName

#CacheFileArgs

type CacheFileArgs = { arch :: Maybe String, sourceFile :: FilePath, targetFile :: FilePath, tool :: String, version :: String }

sourceFile: the file to cache into tools. Typically a result of downloadTool which is a guid targetFile: the name of the file name in the tools directory tool: tool name version: version of the tool. semver format arch: architecture of the tool. Defaults to machine architecture

#find

find :: FindArgs -> ExceptT Error Effect (Maybe FilePath)

Finds the path to a tool version in the local installed tool cache

#find'

find' :: { toolName :: String, versionSpec :: String } -> ExceptT Error Effect (Maybe FilePath)

Finds the path to a tool version in the local installed tool cache

#FindArgs

type FindArgs = { arch :: Maybe String, toolName :: String, versionSpec :: String }

toolName: name of the tool version: version of the tool. arch: architecture of the tool. Defaults to machine architecture

#findAllVersions

findAllVersions :: FindAllVersionsArgs -> ExceptT Error Effect (Array FilePath)

Finds the paths to all versions of a tool that are installed in the local tool cache

#findAllVersions'

findAllVersions' :: String -> ExceptT Error Effect (Array FilePath)

Finds the paths to all versions of a tool that are installed in the local tool cache

#FindAllVersionsArgs

type FindAllVersionsArgs = { arch :: Maybe String, toolName :: String }

toolName: name of the tool arch: architecture of the tool. Defaults to machine architecture

#getManifestFromRepo

getManifestFromRepo :: GetManifestFromRepoArgs -> ExceptT Error Aff (Array IToolRelease)

Get list of releases from a repository

#getManifestFromRepo'

getManifestFromRepo' :: { owner :: String, repo :: String } -> ExceptT Error Aff (Array IToolRelease)

Get list of releases from a repository

#GetManifestFromRepoArgs

type GetManifestFromRepoArgs = { auth :: Maybe String, branch :: Maybe String, owner :: String, repo :: String }

owner: repository owner repo: repository name auth: auth token branch: branch of the repository. Defaults to 'master'

#findFromManifest

findFromManifest :: FindFromManifestArgs -> ExceptT Error Aff (Maybe IToolRelease)

Search list of releases from a repository

#FindFromManifestArgs

type FindFromManifestArgs = { archFilter :: Maybe String, manifest :: Array IToolRelease, stable :: Boolean, versionSpec :: String }

versionSpec: version to search for stable: whether or not the release is stable manifest: manifests to search archFilter: architecture filter. Defaults to machine architecture

#IToolRelease

type IToolRelease = { files :: Array IToolReleaseFile, releaseUrl :: String, stable :: Boolean, version :: String }

Details for a release

#IToolReleaseFile

type IToolReleaseFile = { arch :: String, downloadUrl :: String, filename :: String, platform :: String, platformVersion :: Maybe String }

Details for a release file

Modules