diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 225442a..d2d2b80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: - uses: actions/checkout@v3 with: + fetch-depth: 0 token: ${{ secrets.TINKOFF_BOT_PAT }} - uses: actions/setup-node@v3 @@ -36,6 +37,9 @@ jobs: - name: Build run: npm run build + - name: Copy declaration files + run: npm run copy-declaration-files + - name: Release run: npm run release env: diff --git a/package.json b/package.json index fd10cdc..aaf00df 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "prebenchmark": "npm install --no-save ts-node lodash ramda lazy.js underscore", "docs": "node ./generate/docs/index.js", "test": "jest --coverage", - "test:ci": "npm run test -- --maxWorkers=50%" + "test:ci": "npm run test -- --maxWorkers=50%", + "copy-declaration-files": "node tools/copy-declaration-files.js" }, "description": "Fast, small and purely functional utility library", "repository": "https://github.com/Tinkoff/utils.js", @@ -23,6 +24,11 @@ "curry", "performance" ], + "files": [ + "build", + ".npmignore", + "CHANGELOG.md" + ], "sideEffects": false, "license": "Apache-2.0", "devDependencies": { diff --git a/tools/copy-declaration-files.js b/tools/copy-declaration-files.js new file mode 100644 index 0000000..a285aba --- /dev/null +++ b/tools/copy-declaration-files.js @@ -0,0 +1,14 @@ +const path = require('path'); +const fsExtra = require('fs-extra'); +const recursiveReadSync = require('recursive-readdir-sync'); + +Promise.all( + recursiveReadSync(path.join(__dirname, '..', 'ts_temp')) + .filter(fileName => fileName.endsWith('.d.ts')) + .map(fileName => + fsExtra.copy( + fileName, + fileName.replace('ts_temp', 'build') + ) + ) +);