-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare all necessary JS artifacts for build task (#25842)
Co-authored-by: Lykoi18 <[email protected]>
- Loading branch information
Showing
9 changed files
with
159 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Update version in all workspaces | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch_name: | ||
type: string | ||
description: XX_X Branch name (23_2+) | ||
required: true | ||
version: | ||
type: string | ||
description: XX.X.X Set exact version | ||
required: true | ||
|
||
jobs: | ||
update_version: | ||
name: Update version and create PR | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get sources | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch_name }} | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.16.1' | ||
|
||
- name: Setup git config | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "DX Robot" | ||
- name: Install packages in devextreme repo | ||
run: npm install --no-audit --no-fund | ||
|
||
- name: Bump version | ||
run: npm run all:update-version -- ${{ inputs.version }} | ||
|
||
- name: Commit changes and make PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DX_ROBOT_PAT }} | ||
branch_name: 'robot/update-version-${{ inputs.version }}' | ||
run: | | ||
git checkout -b $branch_name | ||
git add . -N | ||
git commit -a -m "Bump devextreme version" | ||
git push --set-upstream origin $branch_name --force | ||
gh pr create --base ${{ inputs.branch_name }} --title "Bump devextreme version (${{ inputs.version }})" --body "Bump devextreme version" --reviewer DevExpress/devextreme-devops | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import sh from 'shelljs'; | ||
import path from 'node:path'; | ||
|
||
const MONOREPO_ROOT = path.join(__dirname, '..'); | ||
const INTERNAL_TOOLS_ARTIFACTS = path.join(MONOREPO_ROOT, 'artifacts', 'internal-tools'); | ||
|
||
const OUTPUT_DIR = path.join(MONOREPO_ROOT, 'artifacts'); | ||
const NPM_OUTPUT_DIR = path.join(OUTPUT_DIR, 'npm'); | ||
|
||
sh.mkdir('-p', NPM_OUTPUT_DIR); | ||
|
||
const { 'devextreme-main': devextremeVersion, devextreme: devextremeNpmVersion } = JSON.parse(sh.exec('npm pkg get version -ws --json').stdout); | ||
const MAJOR_VERSION = devextremeVersion.split('.').slice(0, 2).join('_'); | ||
|
||
// Prepare metadata | ||
sh.cd(MONOREPO_ROOT); | ||
sh.exec('npm run tools:discover-declarations'); | ||
sh.exec(`npm run tools -- make-aspnet-metadata --version ${MAJOR_VERSION}`); | ||
|
||
// Inject descriptions | ||
const DOCUMENTATION_TEMP_DIR = path.join(OUTPUT_DIR, 'doc_tmp'); | ||
sh.exec(`git clone -b ${MAJOR_VERSION} --depth 1 --config core.longpaths=true https://github.com/DevExpress/devextreme-documentation.git ${DOCUMENTATION_TEMP_DIR}`); | ||
|
||
sh.pushd(DOCUMENTATION_TEMP_DIR); | ||
sh.exec('npm i'); | ||
sh.exec(`npm run update-topics -- --artifacts ${INTERNAL_TOOLS_ARTIFACTS}`); | ||
sh.popd(); | ||
|
||
sh.rm('-rf', DOCUMENTATION_TEMP_DIR); | ||
|
||
sh.exec('npm run devextreme:inject-descriptions'); | ||
|
||
sh.exec('npm run build-dist -w devextreme-main'); | ||
|
||
// Copy artifacts for DXBuild (Installation) | ||
sh.pushd(path.join(MONOREPO_ROOT, 'packages/devextreme/artifacts')); | ||
sh.cp('-r', 'ts', OUTPUT_DIR); | ||
sh.cp('-r', 'js', OUTPUT_DIR); | ||
sh.cp('-r', 'css', OUTPUT_DIR); | ||
sh.popd(); | ||
|
||
// TODO: maybe we should add bootstrap to vendors | ||
const BOOTSTRAP_DIR = path.join(MONOREPO_ROOT, 'node_modules', 'bootstrap', 'dist'); | ||
sh.cp([path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.js'), path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.min.js')], path.join(OUTPUT_DIR, 'js')); | ||
sh.cp([path.join(BOOTSTRAP_DIR, 'css', 'bootstrap.css'), path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.min.css')], path.join(OUTPUT_DIR, 'css')); | ||
|
||
// Update versions for non-semver builds (daily, alpha and beta) | ||
if (devextremeVersion !== devextremeNpmVersion) { | ||
sh.exec(`npm run all:update-version -- ${devextremeNpmVersion}`); | ||
} | ||
|
||
const DEVEXTREME_NPM_DIR = path.join(MONOREPO_ROOT, 'packages/devextreme/artifacts/npm'); | ||
|
||
sh.pushd(path.join(DEVEXTREME_NPM_DIR, 'devextreme')) | ||
sh.exec('npm pack'); | ||
sh.cp('*.tgz', NPM_OUTPUT_DIR); | ||
sh.popd(); | ||
|
||
sh.pushd(path.join(DEVEXTREME_NPM_DIR, 'devextreme-dist')) | ||
sh.exec('npm pack'); | ||
sh.cp('*.tgz', NPM_OUTPUT_DIR); | ||
sh.popd(); | ||
|
||
sh.pushd(path.join(MONOREPO_ROOT, 'packages', 'devextreme-themebuilder')) | ||
sh.exec('npm run build && npm run pack'); | ||
sh.cp('dist/*.tgz', NPM_OUTPUT_DIR); | ||
sh.popd(); | ||
|
||
sh.exec('npm run pack --ws --if-present'); | ||
|
||
sh.cp(path.join(MONOREPO_ROOT, 'packages', 'devextreme-angular', 'npm', 'dist', '*.tgz'), NPM_OUTPUT_DIR); | ||
sh.cp(path.join(MONOREPO_ROOT, 'packages', 'devextreme-react', 'npm', '*.tgz'), NPM_OUTPUT_DIR); | ||
sh.cp(path.join(MONOREPO_ROOT, 'packages', 'devextreme-vue', 'npm', '*.tgz'), NPM_OUTPUT_DIR); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sh from 'shelljs'; | ||
import path from 'node:path'; | ||
|
||
const version = process.argv[2]; | ||
|
||
if (version == null) { | ||
console.error(`Usage: 'npm run all:update-version -- $version' (XX.X.X)`); | ||
process.exit(1); | ||
} | ||
|
||
const MONOREPO_ROOT = path.join(__dirname, '..'); | ||
const packagesPath = path.join(MONOREPO_ROOT, 'packages', '**', 'package.json'); | ||
const playgroundsPath = path.join(MONOREPO_ROOT, 'playgrounds', '**', 'package.json'); | ||
|
||
sh.exec(`npm version ${version} -ws --include-workspace-root --git-tag-version=false --workspaces-update=false`); | ||
|
||
sh.sed('-i', /"devextreme(-angular|-react|-vue)?": ".*"/, `"devextreme$1": "~${version}"`, [packagesPath, playgroundsPath]); | ||
|
||
sh.exec('npm i'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters