From 9bd8f8d45b7748268951b5e484d7518aab41fc23 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 27 Apr 2020 17:22:46 -0700 Subject: [PATCH] Version ghcup (#3) * Version ghcup * Don't cache something that needs to be tested for correctness --- .github/workflows/workflow.yml | 7 ------- dist/action.yml | 25 ++++++++++++++++++++----- dist/index.js | 5 +++-- src/installer.ts | 5 +++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c9d2fb4..a7aa56a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -44,13 +44,6 @@ jobs: steps: - uses: actions/checkout@v2 - - - uses: actions/cache@v1 - if: matrix.os == 'macOS-latest' - with: - path: ~/.ghcup - key: ${{ runner.os }}-${{ matrix.ghc }}-ghcup - - uses: ./ with: ghc-version: ${{ matrix.ghc }} diff --git a/dist/action.yml b/dist/action.yml index c9c0612..6d51148 100644 --- a/dist/action.yml +++ b/dist/action.yml @@ -4,25 +4,40 @@ author: 'GitHub' inputs: ghc-version: required: false - description: 'Version of ghc to use.' - default: '8.8' + description: 'Version of GHC to use. If set to "latest", it will always get the latest stable version.' + default: 'latest' cabal-version: required: false - description: 'Version of cabal to use. If set to "latest", it will always get the latest stable version.' + description: 'Version of Cabal to use. If set to "latest", it will always get the latest stable version.' default: 'latest' stack-version: required: false - description: 'Version of stack to use. If set to "latest", it will always get the latest stable version.' + description: 'Version of Stack to use. If set to "latest", it will always get the latest stable version.' default: 'latest' enable-stack: required: false - description: 'If specified, will setup stack' + description: 'If specified, will setup Stack' stack-no-global: required: false description: 'If specified, enable-stack must be set. Prevents installing GHC and Cabal globally' stack-setup-ghc: required: false description: 'If specified, enable-stack must be set. Will run stack setup to install the specified GHC' +outputs: + ghc-path: + description: 'The path of the ghc executable _directory_' + cabal-path: + description: 'The path of the cabal executable _directory_' + stack-path: + description: 'The path of the stack executable _directory_' + cabal-store: + description: 'The path to the cabal store' + ghc-exe: + description: 'The path of the ghc _executable_' + cabal-exe: + description: 'The path of the cabal _executable_' + stack-exe: + description: 'The path of the stack _executable_' runs: using: 'node12' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index f07987d..2e97d94 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2584,7 +2584,7 @@ function escapeProperty(s) { /***/ 447: /***/ (function(module) { -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.0.0.0","2.4.1.0","2.4.0.0","2.2.0.0"],"stack":["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.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.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"]}; /***/ }), @@ -10757,7 +10757,8 @@ async function choco(tool, version) { } async function ghcup(tool, version, os) { core.info(`Attempting to install ${tool} ${version} using ghcup`); - const bin = await tc.downloadTool(`https://downloads.haskell.org/~ghcup/x86_64-${os === 'darwin' ? 'apple-darwin' : 'linux'}-ghcup`); + const v = '0.1.4'; + const bin = await tc.downloadTool(`https://downloads.haskell.org/~ghcup/${v}/x86_64-${os === 'darwin' ? 'apple-darwin' : 'linux'}-ghcup-${v}`); await fs_1.promises.chmod(bin, 0o755); await exec_1.exec(bin, [tool === 'ghc' ? 'install' : 'install-cabal', version]); if (tool === 'ghc') diff --git a/src/installer.ts b/src/installer.ts index e82b7de..4dc1402 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -178,10 +178,11 @@ async function choco(tool: Tool, version: string): Promise { async function ghcup(tool: Tool, version: string, os: OS): Promise { core.info(`Attempting to install ${tool} ${version} using ghcup`); + const v = '0.1.4'; const bin = await tc.downloadTool( - `https://downloads.haskell.org/~ghcup/x86_64-${ + `https://downloads.haskell.org/~ghcup/${v}/x86_64-${ os === 'darwin' ? 'apple-darwin' : 'linux' - }-ghcup` + }-ghcup-${v}` ); await fs.chmod(bin, 0o755);