From 18cb1cda61f39373db6642b3db7fbb593e2d6504 Mon Sep 17 00:00:00 2001 From: abeaucha Date: Fri, 21 May 2021 16:38:48 -0400 Subject: [PATCH] install with debug artifacts --- src/install-python.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/install-python.ts b/src/install-python.ts index 526e7d59..6bbe41dd 100644 --- a/src/install-python.ts +++ b/src/install-python.ts @@ -1,3 +1,4 @@ +import * as fs from 'fs'; import * as path from 'path'; import * as core from '@actions/core'; import * as tc from '@actions/tool-cache'; @@ -49,7 +50,21 @@ async function installPython(workingDirectory: string) { }; if (IS_WINDOWS) { - await exec.exec('powershell', ['./setup.ps1'], options); + const ps1 = './setup.ps1'; + + // augment default options to include debug libraries + const installArgs = + 'DefaultAllUsersTargetDir=$PythonArchPath InstallAllUsers=1'; + + const data = fs.readFileSync(ps1, 'utf8'); + const result = data.replace( + /`(${installArgs})`/g, + '$1 Include_debug=1 Include_symbols=1' + ); + + fs.writeFileSync(ps1, result, 'utf8'); + + await exec.exec('powershell', [ps1], options); } else { await exec.exec('bash', ['./setup.sh'], options); }