This commit is contained in:
smartfrigde 2022-05-23 19:43:00 +02:00
parent 7ca079025f
commit eb94a4c4c9

View file

@ -158,34 +158,45 @@ jobs:
// do whatever filtering you want here, I'm just uploading all the files // do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file); console.log('uploading', file);
if (fs.lstatSync(`./linux/${file}`).isDirectory()) {
console.log("directory, skipping")
} else {
await github.repos.uploadReleaseAsset({ await github.repos.uploadReleaseAsset({
owner, repo, owner, repo,
release_id: release.data.id, release_id: release.data.id,
name: file, name: file,
data: await fs.readFile(`./linux/${file}`) data: await fs.readFile(`./linux/${file}`)
}); });
}
} }
for (let file of await fs.readdir('windows')) { for (let file of await fs.readdir('windows')) {
// do whatever filtering you want here, I'm just uploading all the files // do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file); console.log('uploading', file);
if (fs.lstatSync(`./windows/${file}`).isDirectory()) {
console.log("directory, skipping")
} else {
await github.repos.uploadReleaseAsset({ await github.repos.uploadReleaseAsset({
owner, repo, owner, repo,
release_id: release.data.id, release_id: release.data.id,
name: file, name: file,
data: await fs.readFile(`./windows/${file}`) data: await fs.readFile(`./windows/${file}`)
}); });
}
} }
for (let file of await fs.readdir('macos')) { for (let file of await fs.readdir('macos')) {
// do whatever filtering you want here, I'm just uploading all the files // do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file); console.log('uploading', file);
if (fs.lstatSync(`./macos/${file}`).isDirectory()) {
console.log("directory, skipping")
} else {
await github.repos.uploadReleaseAsset({ await github.repos.uploadReleaseAsset({
owner, repo, owner, repo,
release_id: release.data.id, release_id: release.data.id,
name: file, name: file,
data: await fs.readFile(`./macos/${file}`) data: await fs.readFile(`./macos/${file}`)
}); });
}
} }
env: env:
releaseTag: ${{ steps.vars.outputs.releaseTag }} releaseTag: ${{ steps.vars.outputs.releaseTag }}