Skip to content

Commit 4e1605d

Browse files
committed
Keep tmp director in workspace to keep caching working
1 parent 07dbc8e commit 4e1605d

3 files changed

Lines changed: 13 additions & 17 deletions

File tree

dist/index.js

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,10 @@ async function aptInstallOM(
234234
* @param bit String specifying 32 or 64 bit version.
235235
*/
236236
async function winInstallOM(version: VersionType, bit: string): Promise<void> {
237-
// Download OpenModelica installer to RUNNER_TEMP to avoid workspace cleanup issues on Windows.
238-
// RUNNER_TEMP is automatically cleaned up by the runner after the job completes.
239-
const runnerTemp = process.env['RUNNER_TEMP'] ?? os.tmpdir()
240-
const tmpDir = path.join(runnerTemp, 'setup-openmodelica')
237+
// Download OpenModelica installer to tmp/
241238
const installer = await util.downloadCachedSync(
242239
version.address,
243-
tmpDir,
240+
'tmp',
244241
version.version === 'nightly'
245242
)
246243

@@ -269,11 +266,12 @@ async function winInstallOM(version: VersionType, bit: string): Promise<void> {
269266
path.join('C:\\Program Files\\', openmodelicahome[0])
270267
)
271268

272-
// Clean up. RUNNER_TEMP is automatically cleaned after the job, so failures are non-fatal.
269+
// Clean up. Failures are non-fatal: Windows may briefly lock the installer file
270+
// after execution (e.g. antivirus scan), so we warn rather than fail the action.
273271
try {
274-
fs.rmSync(tmpDir, {recursive: true, force: true, maxRetries: 10})
272+
fs.rmSync('tmp', {recursive: true, force: true, maxRetries: 10})
275273
} catch (err) {
276-
core.warning(`Failed to remove installer temp directory ${tmpDir}: ${err}`)
274+
core.warning(`Failed to remove installer temp directory: ${err}`)
277275
}
278276
}
279277

0 commit comments

Comments
 (0)