Fix npm publish

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artem Savchenko
2026-02-23 20:40:32 +07:00
parent 2f358b2e55
commit 7dc9a7a7fa
2 changed files with 21 additions and 3 deletions
+3 -1
View File
@@ -969,4 +969,6 @@ jobs:
run: |
REF="${{ github.event.inputs.ref || github.ref }}"
VERSION="${REF#refs/tags/v}"
node common/scripts/bump.js "$VERSION" --publish
VERSION="${VERSION#v}"
node common/scripts/bump.js "$VERSION"
node common/scripts/safe-publish.js
+18 -2
View File
@@ -43,8 +43,24 @@ function checkPackageExists(packageName, version) {
*/
function getPublishablePackages(includePattern) {
try {
const output = execSync('rush list -p --json', { encoding: 'utf-8' })
const config = JSON.parse(output)
const repoRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim()
const output = execSync('node common/scripts/install-run-rush.js list -p --json', {
encoding: 'utf-8',
cwd: repoRoot
})
const lines = output.split('\n')
let jsonStart = -1
for (let i = 0; i < lines.length; i++) {
if (lines[i].trim().startsWith('{')) {
jsonStart = i
break
}
}
if (jsonStart === -1) {
console.error('Could not find JSON output from rush list')
return []
}
const config = JSON.parse(lines.slice(jsonStart).join('\n'))
return config.projects.filter((project) => {
// Check if package should be published according to rush.json