diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 42898cd108..c5d537475f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -330,63 +330,3 @@ jobs: run: | echo Pushing release of tag ${{ github.ref }} node common/scripts/install-run-rush.js docker:push - - npm-publish: - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - needs: [build, uitest, test, svelte-check] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Cache build results - uses: actions/cache@v3 - env: - cache-name: cache-build-results - with: - path: | - cloud - common - deploy - dev - models - packages - plugins - pods - products - server - server-plugins - templates - tests - rush.json - .prettierrc - tools - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} - - - name: Installing... - run: node common/scripts/install-run-rush.js install - - name: Setting model version from git release... - run: node common/scripts/install-run-rush.js bump-model-version - - name: Build, to include new model version - run: node common/scripts/install-run-rush.js build - - name: Bundle - run: node common/scripts/install-run-rush.js bundle - - name: Login to NPM - run: | - echo @hcengineering/anticrm:https://npm.pkg.github.com/ > ~/.npmrc - echo '//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}' >> ~/.npmrc - - name: NPM bump - run: node common/scripts/bump.js - - - name: Create PR - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Bump packages - title: Bump packages - body: Bump packages - base: main - labels: automated-pr - branch: bump_packages - delete-branch: true diff --git a/common/config/rush/command-line.json b/common/config/rush/command-line.json index 481d9bb4fb..0c4a412b2c 100644 --- a/common/config/rush/command-line.json +++ b/common/config/rush/command-line.json @@ -324,6 +324,14 @@ "description": "Format and autofix linting issues in changed projects", "safeForSimultaneousRushProcesses": true, "shellCommand": "./common/scripts/each-diff.sh rushx format" + }, + { + "commandKind": "global", + "name": "bump-packages", + "summary": "Bump and publish packages from last tag", + "description": "Bump and publish packages from last tag", + "safeForSimultaneousRushProcesses": true, + "shellCommand": "node common/scripts/bump.js" } ], diff --git a/common/scripts/bump.js b/common/scripts/bump.js index af504e5c93..81b2630821 100755 --- a/common/scripts/bump.js +++ b/common/scripts/bump.js @@ -94,21 +94,17 @@ function bumpPackage (name, dependency, depVersion) { function publish (name) { const package = packages[name] - execSync(`cd ${package.path} && npm publish && cd ../..`, { encoding: 'utf-8' }) -} - -function getConfig () { - const res = execSync('node common/scripts/install-run-rush.js list -p --json', { encoding: 'utf-8' }) - const index = res.indexOf('{') - const list = res.substring(index) - const config = JSON.parse(list) - return config + try { + execSync(`cd ${package.path} && npm publish && cd ../..`, { encoding: 'utf-8' }) + } catch (err) { + console.log(err) + } } function main () { const args = process.argv - const config = getConfig() + const config = JSON.parse(execSync('rush list -p --json', { encoding: 'utf-8' })) fillPackages(config) buildDependencyTree() @@ -116,11 +112,11 @@ function main () { let changedPackages = [] if (args[2] === '-p') { changedPackages = args[3].split(',').map((p) => `${repo}/${p}`) + } else if (args[2] === '-all') { + changedPackages = Object.keys(packages) } else { - const tags = execSync(`git tag -l v* --sort=committerdate`, { encoding: 'utf-8' }).split('\n').filter((p) => p !== '') - const current = tags[tags.length - 1] - const last = tags[tags.length - 2] - const diff = execSync(`git diff ${current} ${last} --name-only --diff-filter=ACMR | sed 's| |\\ |g\'`, { encoding: 'utf-8' }) + const tag = execSync(`git describe --tags --abbrev=0`, { encoding: 'utf-8' }) + const diff = execSync(`git diff ${tag} --name-only --diff-filter=ACMR | sed 's| |\\ |g\'`, { encoding: 'utf-8' }) const changedFiles = diff.split('\n') changedPackages = getChangedPackages(changedFiles) } diff --git a/packages/model/package.json b/packages/model/package.json index ac23ca7d1b..e1a3460d70 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -31,5 +31,9 @@ "@hcengineering/platform": "^0.6.8", "toposort": "^2.0.2", "fast-equals": "^2.0.3" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/packages/panel/package.json b/packages/panel/package.json index 9d8cd54def..7e92574024 100644 --- a/packages/panel/package.json +++ b/packages/panel/package.json @@ -42,5 +42,9 @@ "@hcengineering/activity": "^0.6.0", "@hcengineering/calendar": "^0.6.2", "@hcengineering/notification": "^0.6.5" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/packages/query/package.json b/packages/query/package.json index 61d144843d..282745e73d 100644 --- a/packages/query/package.json +++ b/packages/query/package.json @@ -31,5 +31,9 @@ "@hcengineering/platform": "^0.6.8", "@hcengineering/core": "^0.6.21", "fast-equals": "^2.0.3" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/activity-assets/package.json b/plugins/activity-assets/package.json index bd7c4835b9..bbba8aaf0f 100644 --- a/plugins/activity-assets/package.json +++ b/plugins/activity-assets/package.json @@ -32,5 +32,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/activity": "^0.6.0" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/attachment-assets/package.json b/plugins/attachment-assets/package.json index a313114b07..21f34d5e63 100644 --- a/plugins/attachment-assets/package.json +++ b/plugins/attachment-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/attachment": "^0.6.1" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/board-assets/package.json b/plugins/board-assets/package.json index fc7c2dbe5f..3fbacfaeb5 100644 --- a/plugins/board-assets/package.json +++ b/plugins/board-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/board": "^0.6.0" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/board/package.json b/plugins/board/package.json index 09b980436f..c85c304d65 100644 --- a/plugins/board/package.json +++ b/plugins/board/package.json @@ -34,5 +34,9 @@ "@hcengineering/ui": "^0.6.3", "@hcengineering/preference": "^0.6.2", "@hcengineering/tags": "^0.6.3" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/calendar-assets/package.json b/plugins/calendar-assets/package.json index 77cdbea0f1..3a32580573 100644 --- a/plugins/calendar-assets/package.json +++ b/plugins/calendar-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/calendar": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/chunter-assets/package.json b/plugins/chunter-assets/package.json index efa6d81874..2d33523066 100644 --- a/plugins/chunter-assets/package.json +++ b/plugins/chunter-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/chunter": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/contact-assets/package.json b/plugins/contact-assets/package.json index 351be1513a..f416219c90 100644 --- a/plugins/contact-assets/package.json +++ b/plugins/contact-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/contact": "^0.6.11" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/hr-assets/package.json b/plugins/hr-assets/package.json index 1de1ba63c7..5c2f892811 100644 --- a/plugins/hr-assets/package.json +++ b/plugins/hr-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/hr": "^0.6.0" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/hr/package.json b/plugins/hr/package.json index a40a6147cb..f21e7aeae3 100644 --- a/plugins/hr/package.json +++ b/plugins/hr/package.json @@ -30,5 +30,9 @@ "@hcengineering/core": "^0.6.21", "@hcengineering/platform": "^0.6.8", "@hcengineering/view": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/inventory-assets/package.json b/plugins/inventory-assets/package.json index d561241450..c29e0614ff 100644 --- a/plugins/inventory-assets/package.json +++ b/plugins/inventory-assets/package.json @@ -32,5 +32,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/inventory": "^0.6.0" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/inventory/package.json b/plugins/inventory/package.json index 4ae66304bf..2b891e816e 100644 --- a/plugins/inventory/package.json +++ b/plugins/inventory/package.json @@ -28,5 +28,9 @@ "dependencies": { "@hcengineering/core": "^0.6.21", "@hcengineering/platform": "^0.6.8" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/login/package.json b/plugins/login/package.json index 0fc3aae22b..d320c85921 100644 --- a/plugins/login/package.json +++ b/plugins/login/package.json @@ -28,5 +28,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/ui": "^0.6.3" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/notification-assets/package.json b/plugins/notification-assets/package.json index 3270a014a3..861ff3cdbb 100644 --- a/plugins/notification-assets/package.json +++ b/plugins/notification-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/notification": "^0.6.5" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/recruit-assets/package.json b/plugins/recruit-assets/package.json index 5c94bbfcd8..947e30f315 100644 --- a/plugins/recruit-assets/package.json +++ b/plugins/recruit-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/recruit": "^0.6.6" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/setting-assets/package.json b/plugins/setting-assets/package.json index f748d9227e..ef1ac213f4 100644 --- a/plugins/setting-assets/package.json +++ b/plugins/setting-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/setting": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/task-assets/package.json b/plugins/task-assets/package.json index 046ebb0c38..ad2709ff66 100644 --- a/plugins/task-assets/package.json +++ b/plugins/task-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/task": "^0.6.1" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/templates-assets/package.json b/plugins/templates-assets/package.json index 8bf6cb4512..aa0432f64b 100644 --- a/plugins/templates-assets/package.json +++ b/plugins/templates-assets/package.json @@ -32,5 +32,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/templates": "^0.6.0" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/templates/package.json b/plugins/templates/package.json index 882cca380d..377273184d 100644 --- a/plugins/templates/package.json +++ b/plugins/templates/package.json @@ -29,5 +29,9 @@ "@hcengineering/platform": "^0.6.8", "@hcengineering/core": "^0.6.21", "@hcengineering/ui": "^0.6.3" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/view-assets/package.json b/plugins/view-assets/package.json index 555d6cea5f..5eb56a1189 100644 --- a/plugins/view-assets/package.json +++ b/plugins/view-assets/package.json @@ -31,5 +31,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/view": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/workbench-assets/package.json b/plugins/workbench-assets/package.json index e33223e454..6635b8437b 100644 --- a/plugins/workbench-assets/package.json +++ b/plugins/workbench-assets/package.json @@ -32,5 +32,9 @@ "dependencies": { "@hcengineering/platform": "^0.6.8", "@hcengineering/workbench": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/plugins/workbench/package.json b/plugins/workbench/package.json index 3836de8bda..873d2b2132 100644 --- a/plugins/workbench/package.json +++ b/plugins/workbench/package.json @@ -31,5 +31,9 @@ "@hcengineering/ui": "^0.6.3", "@hcengineering/view": "^0.6.2", "@hcengineering/preference": "^0.6.2" + }, + "repository": "https://github.com/hcenginneing/anticrm", + "publishConfig": { + "registry": "https://npm.pkg.github.com" } } diff --git a/rush.json b/rush.json index cde002db4a..f1249182da 100644 --- a/rush.json +++ b/rush.json @@ -1271,7 +1271,7 @@ { "packageName": "@hcengineering/board", "projectFolder": "plugins/board", - "shouldPublish": false + "shouldPublish": true }, { "packageName": "@hcengineering/board-assets",