Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bump from CI #2670

Merged
merged 2 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
],

Expand Down
24 changes: 10 additions & 14 deletions common/scripts/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,29 @@ 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()

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)
}
Expand Down
4 changes: 4 additions & 0 deletions packages/model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions packages/panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions packages/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/activity-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/attachment-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/board-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/calendar-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/chunter-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/contact-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/hr-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/hr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/inventory-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/inventory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/notification-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/recruit-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/setting-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/task-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/templates-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/view-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/workbench-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions plugins/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@
{
"packageName": "@hcengineering/board",
"projectFolder": "plugins/board",
"shouldPublish": false
"shouldPublish": true
},
{
"packageName": "@hcengineering/board-assets",
Expand Down