Skip to content

Commit

Permalink
Only match needed files
Browse files Browse the repository at this point in the history
  • Loading branch information
dappnodedev committed Aug 6, 2024
1 parent a7b30ba commit eaa4d12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/providers/github/Github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ export class Github {
async uploadReleaseAssets({
releaseId,
assetsDir,
ignorePattern,
matchPattern,
fileNamePrefix
}: {
releaseId: number;
assetsDir: string;
ignorePattern?: RegExp;
matchPattern?: RegExp;
fileNamePrefix?: string;
}) {
for (const file of fs.readdirSync(assetsDir)) {
// Used to ignore duplicated legacy .tar.xz image
if (ignorePattern && ignorePattern.test(file)) continue;
if (matchPattern && !matchPattern.test(file)) continue;

const filepath = path.resolve(assetsDir, file);
const contentType = mime.lookup(filepath) || "application/octet-stream";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ async function uploadAssets({
await github.uploadReleaseAssets({
releaseId,
assetsDir: releaseDir,
ignorePattern: /\.tar\.xz$/,
// Only upload yml, txz and dappnode_package.json files
matchPattern: /(.*\.ya?ml$)|(.*\.txz$)|(dappnode_package\.json)/,
fileNamePrefix: isMultiVariant ? `${shortDnpName}_` : ""
});

Expand Down

0 comments on commit eaa4d12

Please sign in to comment.