diff --git a/src/mill.ts b/src/mill.ts index f588f7e7..3d01a55c 100644 --- a/src/mill.ts +++ b/src/mill.ts @@ -5,6 +5,11 @@ import * as io from '@actions/io' import * as tc from '@actions/tool-cache' import * as exec from '@actions/exec' +/** + * Installs `Mill` and add its executable to the `PATH`. + * + * Throws error if the installation fails. + */ export async function install(): Promise { try { const millVersion = core.getInput('mill-version') || '0.10.9' @@ -60,3 +65,10 @@ export async function install(): Promise { core.info(`✓ Mill installed, version: ${version.trim()}`) return version } + +/** + * Removes Mill binary + */ +export async function remove(): Promise { + await io.rmRF(path.join(path.join(os.homedir(), 'bin'), 'mill')) +} diff --git a/src/post.ts b/src/post.ts index 7f885537..618876ca 100644 --- a/src/post.ts +++ b/src/post.ts @@ -1,6 +1,7 @@ import * as core from '@actions/core' import * as workspace from './workspace' import * as coursier from './coursier' +import * as mill from './mill' /** * Performs a cleanup of all the artifacts/folders created by this action. @@ -11,6 +12,8 @@ async function post(): Promise { core.info('🗑 Scala Steward\'s workspace removed') await coursier.remove() core.info('🗑 Coursier binary removed') + await mill.remove() + core.info('🗑 Mill binary removed') } catch (error: unknown) { core.warning((error as Error).message) }