diff --git a/dist/index.js b/dist/index.js index 62746316..e8ef8e58 100644 --- a/dist/index.js +++ b/dist/index.js @@ -148557,17 +148557,6 @@ async function installUnixSystemPackages() { } } } -async function updateUnixPackageIndexFiles() { - const isGitHubRunner = external_node_process_.env.GITHUB_ACTIONS === "true"; - if (isGitHubRunner) { - if (PLATFORM === "linux") { - await (0,lib_exec.exec)("sudo", ["apt-get", "update"]); - } - else if (PLATFORM === "macos") { - await (0,lib_exec.exec)("brew", ["update"]); - } - } -} ;// CONCATENATED MODULE: ./src/opam.ts @@ -148632,17 +148621,9 @@ async function acquireOpam() { } async function initializeOpam() { await lib_core.group("Initialise opam state", async () => { + await (0,lib_exec.exec)("opam", ["update", "--depexts"]); if (PLATFORM !== "windows") { - try { - await installUnixSystemPackages(); - } - catch (error) { - if (error instanceof Error) { - lib_core.notice(`An error has been caught in some system package index files, so the system package index files have been re-synchronised, and the system package installation has been retried: ${error.message.toLocaleLowerCase()}`); - } - await updateUnixPackageIndexFiles(); - await installUnixSystemPackages(); - } + await installUnixSystemPackages(); } const extraOptions = []; if (PLATFORM === "windows") { diff --git a/packages/setup-ocaml/src/opam.ts b/packages/setup-ocaml/src/opam.ts index 1a215271..a3c00199 100644 --- a/packages/setup-ocaml/src/opam.ts +++ b/packages/setup-ocaml/src/opam.ts @@ -13,10 +13,7 @@ import { OPAM_DISABLE_SANDBOXING, PLATFORM, } from "./constants.js"; -import { - installUnixSystemPackages, - updateUnixPackageIndexFiles, -} from "./unix.js"; +import { installUnixSystemPackages } from "./unix.js"; export async function retrieveLatestOpamRelease() { const semverRange = ALLOW_PRERELEASE_OPAM ? "*" : "<2.4.0"; @@ -88,18 +85,9 @@ async function acquireOpam() { async function initializeOpam() { await core.group("Initialise opam state", async () => { + await exec("opam", ["update", "--depexts"]); if (PLATFORM !== "windows") { - try { - await installUnixSystemPackages(); - } catch (error) { - if (error instanceof Error) { - core.notice( - `An error has been caught in some system package index files, so the system package index files have been re-synchronised, and the system package installation has been retried: ${error.message.toLocaleLowerCase()}`, - ); - } - await updateUnixPackageIndexFiles(); - await installUnixSystemPackages(); - } + await installUnixSystemPackages(); } const extraOptions = []; if (PLATFORM === "windows") { diff --git a/packages/setup-ocaml/src/unix.ts b/packages/setup-ocaml/src/unix.ts index abb58704..74162925 100644 --- a/packages/setup-ocaml/src/unix.ts +++ b/packages/setup-ocaml/src/unix.ts @@ -56,14 +56,3 @@ export async function installUnixSystemPackages() { } } } - -export async function updateUnixPackageIndexFiles() { - const isGitHubRunner = process.env.GITHUB_ACTIONS === "true"; - if (isGitHubRunner) { - if (PLATFORM === "linux") { - await exec("sudo", ["apt-get", "update"]); - } else if (PLATFORM === "macos") { - await exec("brew", ["update"]); - } - } -}