Skip to content

Commit

Permalink
Merge pull request #1011 from ckeditor/epic/3757-esm
Browse files Browse the repository at this point in the history
Fix (release-tools): Passing an odd number as a value of the `concurrency` option will not crash the `executeInParallel()` function. Closes ckeditor/ckeditor5#17025.

Other: The CKEditor 5 Dev packages are now ESM.

Other: The `@ckeditor/jsdoc-plugins` package is no longer available as CKEditor 5 documentation uses TypeScript sources to prepare API docs. The package is no longer use by us anywhere. Hence, we decided to remove a dead code.

MAJOR BREAKING CHANGE (utils): The `builds.getDllPluginWebpackConfig()` function is now asynchronous now.

MAJOR BREAKING CHANGE (utils): The following functions from the `bundler` object are no longer available: `createEntryFile()`, `getEditorConfig()`, `getPlugins()`.

MAJOR BREAKING CHANGE (utils): The following functions from the `stream` object are no longer available: `isTestFile()`, `isSourceFile()`, `isJSFile()`.

MAJOR BREAKING CHANGE (utils): The `styles.themeLogger()` function is no longer exposed publicly.

MAJOR BREAKING CHANGE (tests): The IntelliJ Karma configuration path needs to be updated. Now, it ends with the `cjs` suffix instead of `js`.

MAJOR BREAKING CHANGE (docs): The package uses only TypeDoc to build the documentation. The `build()` function no longer supports `type` property in the configuration.

MAJOR BREAKING CHANGE (docs): An array of ignored files must be specified as `ignoreFiles` instead of negating a glob pattern in `sourceFiles`.

MAJOR BREAKING CHANGE: The following packages have been converted to ESM. To load them, use an `import` statement instead of `require()`.
  * [`@ckeditor/ckeditor5-dev-build-tools`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-build-tools)
  * [`@ckeditor/ckeditor5-dev-bump-year`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-bump-year)
  * [`@ckeditor/ckeditor5-dev-ci`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-ci)
  * [`@ckeditor/ckeditor5-dev-dependency-checker`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-dependency-checker)
  * [`@ckeditor/ckeditor5-dev-docs`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-docs)
  * [`@ckeditor/ckeditor5-dev-release-tools`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)
  * [`@ckeditor/ckeditor5-dev-stale-bot`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-stale-bot)
  * [`@ckeditor/ckeditor5-dev-tests`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-tests)
  * [`@ckeditor/ckeditor5-dev-transifex`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-transifex)
  * [`@ckeditor/ckeditor5-dev-translations`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-translations)
  * [`@ckeditor/ckeditor5-dev-utils`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-utils)
  * [`@ckeditor/ckeditor5-dev-web-crawler`](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-web-crawler)
  • Loading branch information
pomek authored Oct 2, 2024
2 parents 2c49f99 + 20bd94c commit 50c744e
Show file tree
Hide file tree
Showing 444 changed files with 19,864 additions and 26,914 deletions.
267 changes: 29 additions & 238 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# This is the based configuration required by CircleCI to run a build.
#
# The repository uses the dynamic configuration to generate
# tasks for executing tests and checking the code coverage.
#
# This configuration aims to prepare a complete design and continue checking
# the repository in a new workflow.
#
# To modify the commands to execute on CI, review the following files:
# - scripts/ci/generate-circleci-configuration.js - the script that creates the `config-tests.yml` file used on the new workflow.
# - .circleci/template.yml - the template filled with data to execute.
#
# Useful resources:
# - https://circleci.com/docs/using-dynamic-configuration/
version: 2.1

setup: true

parameters:
triggerCommitHash:
type: string
Expand All @@ -11,259 +27,34 @@ parameters:
type: boolean
default: false

commands:
bootstrap_repository_command:
description: "Bootstrap the repository"
steps:
- install_ssh_keys_command
- run:
name: Install dependencies
command: yarn install
- prepare_environment_variables_commands
orbs:
continuation: circleci/[email protected]

commands:
install_ssh_keys_command:
description: "Install SSH keys"
steps:
- add_ssh_keys:
fingerprints:
- "a0:41:a2:56:c8:7d:3f:29:41:d1:87:92:fd:50:2b:6b"

npm_login_command:
description: "Enable interacting with `npm` using an auth token"
steps:
- run:
name: Login to the npm registry using '.npmrc' file
command: echo "//registry.npmjs.org/:_authToken=\${CKE5_NPM_TOKEN}" > ~/.npmrc

git_credentials_command:
description: "Setup git configuration"
steps:
- run:
name: Setup git configuration
command: |
git config --global user.email "[email protected]"
git config --global user.name "CKEditorBot"
prepare_environment_variables_commands:
description: "Prepare non-secret environment variables"
steps:
- run:
name: Prepare environment variables
command: |
#!/bin/bash
# Non-secret environment variables needed for the pipeline scripts.
CKE5_GITHUB_ORGANIZATION="ckeditor"
CKE5_GITHUB_REPOSITORY="ckeditor5-dev"
CKE5_CIRCLE_APPROVAL_JOB_NAME="release_approval"
CKE5_GITHUB_RELEASE_BRANCH="master"
echo export CKE5_CIRCLE_APPROVAL_JOB_NAME=$CKE5_CIRCLE_APPROVAL_JOB_NAME >> $BASH_ENV
echo export CKE5_GITHUB_RELEASE_BRANCH=$CKE5_GITHUB_RELEASE_BRANCH >> $BASH_ENV
echo export CKE5_GITHUB_ORGANIZATION=$CKE5_GITHUB_ORGANIZATION >> $BASH_ENV
echo export CKE5_GITHUB_REPOSITORY=$CKE5_GITHUB_REPOSITORY >> $BASH_ENV
echo export CKE5_GITHUB_REPOSITORY_SLUG="$CKE5_GITHUB_ORGANIZATION/$CKE5_GITHUB_REPOSITORY" >> $BASH_ENV
echo export CKE5_COMMIT_SHA1=$CIRCLE_SHA1 >> $BASH_ENV
jobs:
notify_ci_failure:
machine: true
parameters:
hideAuthor:
type: string
default: "false"
steps:
- checkout
- bootstrap_repository_command
- run:
# In the PRs that comes from forked repositories, we do not share secret variables.
# Hence, some of the scripts will not be executed.
name: 👤 Verify if the build was triggered by community - Check if the build should continue
command: |
#!/bin/bash
if [[ -z ${COVERALLS_REPO_TOKEN} ]];
then
circleci-agent step halt
fi
- run:
environment:
CKE5_SLACK_NOTIFY_HIDE_AUTHOR: << parameters.hideAuthor >>
CKE5_PIPELINE_NUMBER: << pipeline.number >>
name: Waiting for other jobs to finish and sending notification on failure
command: yarn ckeditor5-dev-ci-circle-workflow-notifier
no_output_timeout: 1h

validate_and_tests:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
- run:
name: Execute ESLint
command: yarn run lint
- run:
name: Run unit tests
command: yarn run coverage
- unless:
# Upload the code coverage results for non-nightly builds only.
condition: << pipeline.parameters.isNightly >>
steps:
- run:
# In the PRs that comes from forked repositories, we do not share secret variables.
# Hence, some of the scripts will not be executed.
name: 👤 Verify if the build was triggered by community - Check if the build should continue
command: |
#!/bin/bash
if [[ -z ${COVERALLS_REPO_TOKEN} ]];
then
circleci-agent step halt
fi
- run:
name: Upload code coverage
command: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

release_prepare:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
- run:
name: Check if packages are ready to be released
command: yarn run release:prepare-packages --verbose --compile-only

trigger_release_process:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
- run:
name: Verify if the project is ready to release
command: |
#!/bin/bash
# Do not fail if the Node script ends with non-zero exit code.
set +e
node scripts/ci/is-project-ready-to-release.js
EXIT_CODE=$( echo $? )
if [ ${EXIT_CODE} -eq 1 ];
then
circleci-agent step halt
fi
- run:
name: Trigger the release pipeline
command: yarn ckeditor5-dev-ci-trigger-circle-build

release_project:
generate_configuration:
machine: true
resource_class: large
steps:
- checkout
- bootstrap_repository_command
- run:
name: Verify the trigger commit from the repository
command: |
#!/bin/bash
CKE5_LATEST_COMMIT_HASH=$( git log -n 1 --pretty=format:%H origin/master )
CKE5_TRIGGER_COMMIT_HASH=<< pipeline.parameters.triggerCommitHash >>
if [[ "${CKE5_LATEST_COMMIT_HASH}" != "${CKE5_TRIGGER_COMMIT_HASH}" ]]; then
echo "There is a newer commit in the repository on the \`#master\` branch. Use its build to start the release."
circleci-agent step halt
fi
- npm_login_command
- git_credentials_command
- run:
name: Verify if a releaser triggered the job
command: |
#!/bin/bash
# Do not fail if the Node script ends with non-zero exit code.
set +e
yarn ckeditor5-dev-ci-is-job-triggered-by-member
EXIT_CODE=$( echo $? )
if [ ${EXIT_CODE} -ne 0 ];
then
echo "Aborting the release due to failed verification of the approver (no rights to release)."
circleci-agent step halt
fi
- run:
name: Disable the redundant workflows option
command: yarn ckeditor5-dev-ci-circle-disable-auto-cancel-builds
- run:
name: Prepare the new version to release
command: npm run release:prepare-packages -- --verbose
- run:
name: Publish the packages
command: npm run release:publish-packages -- --verbose
- install_ssh_keys_command
- run:
name: Enable the redundant workflows option
command: yarn ckeditor5-dev-ci-circle-enable-auto-cancel-builds
when: always
name: Install dependencies
command: yarn install
- run:
name: Pack the "release/" directory (in case of failure)
command: |
zip -r ./release.zip ./release
when: always
- store_artifacts:
path: ./release.zip
when: always
name: Generate a new configuration to check all packages in the repository
command: node scripts/ci/generate-circleci-configuration.js
- continuation/continue:
configuration_path: .circleci/config-tests.yml

workflows:
version: 2
main:
when:
and:
- equal: [ false, << pipeline.parameters.isNightly >> ]
- equal: [ false, << pipeline.parameters.isRelease >> ]
jobs:
- validate_and_tests
- release_prepare
- trigger_release_process:
requires:
- validate_and_tests
- release_prepare
filters:
branches:
only:
- master
- notify_ci_failure:
filters:
branches:
only:
- master

release:
when:
and:
- equal: [ false, << pipeline.parameters.isNightly >> ]
- equal: [ true, << pipeline.parameters.isRelease >> ]
jobs:
- release_approval:
type: approval
- release_project:
requires:
- release_approval

nightly:
when:
and:
- equal: [ true, << pipeline.parameters.isNightly >> ]
- equal: [ false, << pipeline.parameters.isRelease >> ]
config:
jobs:
- validate_and_tests
- notify_ci_failure:
hideAuthor: "true"
filters:
branches:
only:
- master
- generate_configuration
Loading

0 comments on commit 50c744e

Please sign in to comment.