gha: Get correct file name before renaming
This commit is contained in:
5
.github/workflows/Nuget-publishing.yml
vendored
5
.github/workflows/Nuget-publishing.yml
vendored
@@ -45,6 +45,7 @@ jobs:
|
|||||||
let sourceFile = "";
|
let sourceFile = "";
|
||||||
let destDir = "";
|
let destDir = "";
|
||||||
let destFile = "";
|
let destFile = "";
|
||||||
|
var output = {};
|
||||||
for (const artifact of allArtifacts.data.artifacts) {
|
for (const artifact of allArtifacts.data.artifacts) {
|
||||||
switch(artifact.name) {
|
switch(artifact.name) {
|
||||||
case 'ubuntu-cmake-aarch64.7z':
|
case 'ubuntu-cmake-aarch64.7z':
|
||||||
@@ -109,7 +110,9 @@ jobs:
|
|||||||
console.log(`Extracting library from 7z file to: ${destDir}/${sourceFile}`);
|
console.log(`Extracting library from 7z file to: ${destDir}/${sourceFile}`);
|
||||||
await exec.exec("7z", ["e", `-o${destDir}/`, `/home/runner/${artifact.name}`, `${sourceDir}${sourceFile}`], options);
|
await exec.exec("7z", ["e", `-o${destDir}/`, `/home/runner/${artifact.name}`, `${sourceDir}${sourceFile}`], options);
|
||||||
if (sourceFile != destFile) {
|
if (sourceFile != destFile) {
|
||||||
console.log(`Renaming library to: ${destFile}`);
|
output = await exec.getExecOutput("ls", [destDir], options);
|
||||||
|
sourceFile = output.stdout.trim();
|
||||||
|
console.log(`Renaming ${sourceFile} to ${destFile}`);
|
||||||
await exec.exec("mv", [`${destDir}/${sourceFile}`, `${destDir}/${destFile}`], options);
|
await exec.exec("mv", [`${destDir}/${sourceFile}`, `${destDir}/${destFile}`], options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user