Fixes Conan cache cleanup

This commit is contained in:
Dmitry Vedenko 2023-06-26 13:07:19 +03:00
parent e04c171711
commit 91655062ef
No known key found for this signature in database
GPG Key ID: F4C37A6204F983A2
4 changed files with 7 additions and 36 deletions

View File

@ -146,14 +146,6 @@ async function run() {
try{
await configureAudacity();
try {
// If upload fails - do nt fail the build
await conan.uploadBinaries();
} catch(error) {
helpers.error(error.message);
}
await conan.cleanupConanBuilds();
} catch(error) {
helpers.error(error.message);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -55,29 +55,9 @@ async function restoreConanCache(key) {
}
}
async function uploadBinaries() {
const globber = await glob.create(`${workspaceDir}/.conan/data/**/build`);
const files = await globber.glob();
if (files.length == 0) {
helpers.log('No new binaries were built. Skipping upload.');
return;
}
const remote = process.env['CONAN_BINARIES_REMOTE'];
if (remote) {
try {
await helpers.execWithLog(`conan remote add audacity-binaries-upload ${remote} true --force`);
} finally {
await helpers.execWithLog(`conan upload "*" -r audacity-binaries-upload -c --all`);
await helpers.execWithLog(`conan remote remove audacity-binaries-upload`);
}
}
}
async function cleanupConanBuilds() {
helpers.log("Cleaning up conan build cache");
await helpers.execWithLog('conan remove "*" --src --builds --force')
await helpers.execWithLog('conan cache clean "*"')
}
async function storeConanCache(key) {
@ -98,5 +78,4 @@ module.exports = {
restoreConanCache: restoreConanCache,
cleanupConanBuilds: cleanupConanBuilds,
storeConanCache: storeConanCache,
uploadBinaries: uploadBinaries,
}