Skip to content

Commit

Permalink
ci: Fix publish-snapshot not respecting all includes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Dec 3, 2024
1 parent 61402c2 commit 4b06f6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ jobs:
script: |
const fs = require('fs');
const settingsGradle = fs.readFileSync('settings.gradle', 'utf8');
const includePattern = /^(?!\s*\/\/)\s*include\s*\(\s*["']([^"']+)["']\s*\)/gm;
const includes = [...settingsGradle.matchAll(includePattern)].map(match => match[1]);
const includePattern = /^(?!\s*\/\/)\s*include\s*\(\s*(['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])*\s*)\)/gm;
const includes = [...settingsGradle.matchAll(includePattern)]
.flatMap(match => match[0].match(/['"]([^'"]+)['"]/g).map(item => item.replace(/['"]/g, '')));
const includeFabric = includes.includes('fabric');
const includeForge = includes.includes('forge');
const includeNeoForge = includes.includes('neoforge');
return {
loader: ['common', includeFabric ? 'fabric' : false, includeForge ? 'forge' : false, includeNeoForge ? 'neoforge' : false].filter(Boolean),
}
};
publish-snapshot:
runs-on: ubuntu-latest
strategy:
Expand Down

0 comments on commit 4b06f6d

Please sign in to comment.