diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04840030e..b9426e40a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,8 @@ jobs: cache: npm - run: npm ci - run: npm run build + - name: "Fix pkg.files file pattern" + run: node scripts/fix-package-json.js - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/fix-package-json.js b/scripts/fix-package-json.js new file mode 100644 index 000000000..76ab50ef6 --- /dev/null +++ b/scripts/fix-package-json.js @@ -0,0 +1,15 @@ +const fs = require("fs"); +const path = require("path"); +const { EOL } = require("os"); + +const pkgPath = path.join(__dirname, "../pkg/package.json"); +const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); + +pkg.files = pkg.files.map((file) => { + if (file.endsWith("/")) { + return file + "**"; + } + return file; +}); + +fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + EOL, "utf8");