mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +03:00
ci: testing upload build script
This commit is contained in:
parent
9e73a44426
commit
639c7ef1e6
@ -26,8 +26,9 @@ fs.readdir(dist, async (err, files) => {
|
|||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
||||||
const uploads = await Promise.all(
|
const uploads = await Promise.all(
|
||||||
files.map(async (file) => {
|
files
|
||||||
if (extensionsToUpload.includes(path.extname(file))) {
|
.filter((file) => extensionsToUpload.includes(path.extname(file)))
|
||||||
|
.map(async (file) => {
|
||||||
const fileName = `${new Date().getTime()}-${file}`;
|
const fileName = `${new Date().getTime()}-${file}`;
|
||||||
|
|
||||||
const command = new PutObjectCommand({
|
const command = new PutObjectCommand({
|
||||||
@ -42,20 +43,21 @@ fs.readdir(dist, async (err, files) => {
|
|||||||
url: `${process.env.S3_ENDPOINT}/${process.env.S3_BUILDS_BUCKET_NAME}/${fileName}`,
|
url: `${process.env.S3_ENDPOINT}/${process.env.S3_BUILDS_BUCKET_NAME}/${fileName}`,
|
||||||
name: fileName,
|
name: fileName,
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await fetch(process.env.BUILD_WEBHOOK_URL, {
|
if (uploads.length > 0) {
|
||||||
method: "POST",
|
await fetch(process.env.BUILD_WEBHOOK_URL, {
|
||||||
headers: {
|
method: "POST",
|
||||||
"Content-Type": "application/json",
|
headers: {
|
||||||
},
|
"Content-Type": "application/json",
|
||||||
body: JSON.stringify({
|
},
|
||||||
uploads,
|
body: JSON.stringify({
|
||||||
branchName: process.env.BRANCH_NAME,
|
uploads,
|
||||||
version: packageJson.version,
|
branchName: process.env.BRANCH_NAME,
|
||||||
githubActor: process.env.GITHUB_ACTOR,
|
version: packageJson.version,
|
||||||
}),
|
githubActor: process.env.GITHUB_ACTOR,
|
||||||
});
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user