@@ -7,7 +7,7 @@ import * as core from "@actions/core";
7
7
import { exec , getExecOutput } from "@actions/exec" ;
8
8
import * as github from "@actions/github" ;
9
9
import * as io from "@actions/io" ;
10
- import * as tc from "@actions/tool-cache" ;
10
+ import * as toolCache from "@actions/tool-cache" ;
11
11
import * as semver from "semver" ;
12
12
13
13
import { saveCygwinCache } from "./cache.js" ;
@@ -76,11 +76,11 @@ async function findOpam() {
76
76
77
77
async function acquireOpamUnix ( ) {
78
78
const { version, browserDownloadUrl } = await getLatestOpamRelease ( ) ;
79
- const cachedPath = tc . find ( "opam" , version , ARCHITECTURE ) ;
79
+ const cachedPath = toolCache . find ( "opam" , version , ARCHITECTURE ) ;
80
80
if ( cachedPath === "" ) {
81
- const downloadedPath = await tc . downloadTool ( browserDownloadUrl ) ;
81
+ const downloadedPath = await toolCache . downloadTool ( browserDownloadUrl ) ;
82
82
core . info ( `Acquired ${ version } from ${ browserDownloadUrl } ` ) ;
83
- const cachedPath = await tc . cacheFile (
83
+ const cachedPath = await toolCache . cacheFile (
84
84
downloadedPath ,
85
85
"opam" ,
86
86
"opam" ,
@@ -161,12 +161,12 @@ async function setupOpamUnix() {
161
161
162
162
async function setupCygwin ( ) {
163
163
const version = await getCygwinVersion ( ) ;
164
- const cachedPath = tc . find ( "cygwin" , version , "x86_64" ) ;
164
+ const cachedPath = toolCache . find ( "cygwin" , version , "x86_64" ) ;
165
165
if ( cachedPath === "" ) {
166
- const downloadedPath = await tc . downloadTool (
166
+ const downloadedPath = await toolCache . downloadTool (
167
167
"https://cygwin.com/setup-x86_64.exe" ,
168
168
) ;
169
- const cachedPath = await tc . cacheFile (
169
+ const cachedPath = await toolCache . cacheFile (
170
170
downloadedPath ,
171
171
"setup-x86_64.exe" ,
172
172
"cygwin" ,
@@ -208,13 +208,17 @@ async function setupCygwin() {
208
208
209
209
async function acquireOpamWindows ( ) {
210
210
const opamVersion = "0.0.0.2" ;
211
- const cachedPath = tc . find ( "opam" , opamVersion ) ;
211
+ const cachedPath = toolCache . find ( "opam" , opamVersion ) ;
212
212
if ( cachedPath === "" ) {
213
- const downloadedPath = await tc . downloadTool (
213
+ const downloadedPath = await toolCache . downloadTool (
214
214
`https://github.com/fdopen/opam-repository-mingw/releases/download/${ opamVersion } /opam64.zip` ,
215
215
) ;
216
- const extractedPath = await tc . extractZip ( downloadedPath ) ;
217
- const cachedPath = await tc . cacheDir ( extractedPath , "opam" , opamVersion ) ;
216
+ const extractedPath = await toolCache . extractZip ( downloadedPath ) ;
217
+ const cachedPath = await toolCache . cacheDir (
218
+ extractedPath ,
219
+ "opam" ,
220
+ opamVersion ,
221
+ ) ;
218
222
const installSh = path . join ( cachedPath , "opam64" , "install.sh" ) ;
219
223
await fs . chmod ( installSh , 0o755 ) ;
220
224
await exec ( "bash" , [ installSh , "--prefix" , "/usr" ] ) ;
0 commit comments