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

Converted ckeditor5-dev-* packages to ESM #1011

Draft
wants to merge 204 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
0d148a2
Convert the package to ESM.
pomek Sep 3, 2024
98989f5
Vitest init + first test migrated.
pomek Sep 3, 2024
a563fd3
Tests: packages/ckeditor5-dev-release-tools/tests/tasks/commitandtag.…
pomek Sep 3, 2024
7440d95
To merge with ESM.
pomek Sep 3, 2024
dedb081
Converted the package to ESM.
przemyslaw-zan Sep 4, 2024
ee84e7c
Cleanup.
przemyslaw-zan Sep 4, 2024
6d15156
Fixed a vitest config path for the coverage script.
pomek Sep 4, 2024
8aa0ab9
More tests.
pomek Sep 5, 2024
110d33a
Renamed tests paths (vitest).
pomek Sep 5, 2024
2273dfb
Renamed tests.
przemyslaw-zan Sep 5, 2024
5dc0dc6
Merge branch 'ci/3762-ci' of github.com:ckeditor/ckeditor5-dev into c…
przemyslaw-zan Sep 5, 2024
1287821
Mocks are now hoisted to avoid using a non-stable API (constructions).
pomek Sep 5, 2024
316672d
More tests.
pomek Sep 5, 2024
22ddb4e
More and more tests.
pomek Sep 5, 2024
052789b
Added more tests and introduced a helper for more assertions.
pomek Sep 6, 2024
671f9a8
Converted `ckeditor5-dev-docs` to ESM.
psmyrek Sep 6, 2024
edde763
More tests.
pomek Sep 6, 2024
d7dee9f
Util modules are now exported directly instead of wrapping it in an o…
pomek Sep 6, 2024
ed4f770
More tests.
pomek Sep 6, 2024
2bc96e9
ESM requires an extension in a path.
pomek Sep 6, 2024
05b138a
Added extensions in local file imports.
psmyrek Sep 6, 2024
3531b1f
Added test tools to exclusion in Vitest.
psmyrek Sep 6, 2024
18cb47d
More and more.
pomek Sep 6, 2024
281aaea
Breakpoint.
pomek Sep 6, 2024
951a64f
Fixed imports from `typedoc-plugins`.
psmyrek Sep 6, 2024
e80a89c
Added missing extension in imported files.
psmyrek Sep 6, 2024
8684a02
Migrated to ESM.
przemyslaw-zan Sep 6, 2024
28d0a47
Cleanup.
przemyslaw-zan Sep 6, 2024
c6f427d
Review requests.
przemyslaw-zan Sep 6, 2024
dc00635
Updated eslint config.
przemyslaw-zan Sep 6, 2024
3680010
Added file extensions to imports.
przemyslaw-zan Sep 9, 2024
a2bdbe7
Aligned tests in `utils/versions.js`.
psmyrek Sep 9, 2024
15cd226
Aligned tests in `utils/validaterepositorytorelease.js`.
psmyrek Sep 9, 2024
2c2f982
Added file extensions to imports.
przemyslaw-zan Sep 9, 2024
ea67c8e
Aligned tests in `utils/transformcommitutils.js`.
psmyrek Sep 9, 2024
d755828
Merge pull request #997 from ckeditor/ci/3762-ci
pomek Sep 9, 2024
85bdfd7
Merge branch 'epic/3757-esm' into ci/3761-stale-bot
pomek Sep 9, 2024
3dc5e19
Merge pull request #999 from ckeditor/ci/3761-stale-bot
pomek Sep 9, 2024
7e37998
Merge branch 'epic/3757-esm' into ci/3771
pomek Sep 9, 2024
0cb884b
Update .eslintrc.js
pomek Sep 9, 2024
7becfeb
Aligned tests in `utils/transformcommitfactory.js`.
psmyrek Sep 9, 2024
02f5e78
Merge pull request #998 from ckeditor/ci/3771
pomek Sep 9, 2024
59b1f41
Merge branch 'master' into epic/3757-esm
pomek Sep 9, 2024
3dd68f3
Merge branch 'epic/3757-esm' into ci/3759-release-tools
pomek Sep 9, 2024
1099314
Migrated to ESM.
przemyslaw-zan Sep 9, 2024
274a764
Aligned tests in `utils/publishpackageonnpmcallback.js`.
psmyrek Sep 9, 2024
92ff55d
Resolved WIP.
pomek Sep 9, 2024
e36df8d
Aligned tests in `utils/parseroptions.js`.
psmyrek Sep 9, 2024
30c39bd
Merge branch 'ci/3759-release-tools' of github.com:ckeditor/ckeditor5…
psmyrek Sep 9, 2024
1b3f6ee
Converted `ckeditor5-dev-bump-year` to ESM.
martnpaneq Sep 9, 2024
e25f3d6
Aligned tests in `utils/isversionpublishablefortag.js`.
psmyrek Sep 9, 2024
011fbb1
Migrated to ESM.
przemyslaw-zan Sep 9, 2024
ec3f84c
The transformCommitUtils module now exports things instead of a defau…
pomek Sep 9, 2024
5bad9a7
Merge branch 'ci/3759-release-tools' of github.com:ckeditor/ckeditor5…
pomek Sep 9, 2024
2370ade
More tests.
pomek Sep 9, 2024
ddbcf91
Aligned tests in `utils/getwriteroptions.js`.
psmyrek Sep 9, 2024
1d1afaf
Merge branch 'ci/3759-release-tools' of github.com:ckeditor/ckeditor5…
psmyrek Sep 9, 2024
f5fbeea
Aligned tests in `utils/getpackagespaths.js`.
psmyrek Sep 9, 2024
628c9c4
Aligned tests in `utils/getnpmtagfromversion.js`.
psmyrek Sep 9, 2024
2690820
Aligned tests in `utils/getnewversiontype.js`.
psmyrek Sep 9, 2024
df9e49c
Removed "use strict".
martnpaneq Sep 9, 2024
c22740e
Merge pull request #1003 from ckeditor/ci/3769-web-crawler
pomek Sep 9, 2024
c12a027
Merge branch 'epic/3757-esm' into ci/3764-dependency-checker
pomek Sep 9, 2024
7d275ad
Merge pull request #1001 from ckeditor/ci/3764-dependency-checker
pomek Sep 9, 2024
e508573
Merge branch 'epic/3757-esm' into ci/3763-bump-year
pomek Sep 9, 2024
ef53047
Merge pull request #1002 from ckeditor/ci/3763-bump-year
pomek Sep 9, 2024
830377e
Aligned tests in `utils/getcommits.js`.
psmyrek Sep 10, 2024
a551fc5
Aligned tests in `utils/getchangedfilesforcommit.js`.
psmyrek Sep 10, 2024
5798827
Extracted utils from `utils/changelog` to separate files.
pomek Sep 10, 2024
faf553e
Tests for checkVersionAvailability.
pomek Sep 10, 2024
d07eeb2
Aligned tests in `utils/generatechangelog.js`.
psmyrek Sep 10, 2024
74880b0
More tests.
pomek Sep 10, 2024
f1d2e78
Tests for saveChangelog.
pomek Sep 10, 2024
a7281c0
Tests for truncateChangelog.
pomek Sep 10, 2024
660229b
The CLI utils are now exported as a separate modules.
pomek Sep 10, 2024
6c9f3dc
Aligned tests in `utils/abortcontroller.js` and `utils/abortcontrolle…
psmyrek Sep 10, 2024
626fdf8
Tests for displaySkippedPackages.
pomek Sep 10, 2024
d91fcac
Make "executeInParallel()" tests green again.
pomek Sep 10, 2024
4ba08cb
Make all tests green (almost).
pomek Sep 10, 2024
86fe4dd
Converted `ckeditor5-dev-transtaltions` to ESM.
martnpaneq Sep 10, 2024
eea3717
Replaced an integration test with a unit one for a worker script.
pomek Sep 11, 2024
2cb19d5
Do not redeclare already mocked method.
psmyrek Sep 11, 2024
7982e07
Aligned tests in `utils/displaycommits.js`.
psmyrek Sep 11, 2024
ab28cdb
Fixed integration timeouts.
pomek Sep 11, 2024
30bafe5
Make coverage script works again.
pomek Sep 11, 2024
2cc0c81
Use default exports instead of named one.
pomek Sep 11, 2024
83ada41
Merge branch 'epic/3757-esm' into ci/3759-release-tools
pomek Sep 11, 2024
41f4ab7
Minor fixes.
pomek Sep 11, 2024
1f6c780
Simplified the test descriptions.
pomek Sep 11, 2024
22d7d9d
Merge pull request #1005 from ckeditor/ci/3759-release-tools
pomek Sep 11, 2024
2e06dbd
Merge branch 'epic/3757-esm' into ci/3767-translations
pomek Sep 11, 2024
b63d1d3
Merge pull request #1004 from ckeditor/ci/3767-translations
pomek Sep 11, 2024
6690c43
Init.
pomek Sep 11, 2024
0ca7640
Release tools: __dirname.
pomek Sep 11, 2024
59aa6a2
Dev docs: __dirname.
pomek Sep 11, 2024
bf1346d
Dev stale-bot: __dirname.
pomek Sep 11, 2024
f90ec3d
Dev translations: ESM.
pomek Sep 11, 2024
514c615
Removed unused files.
pomek Sep 11, 2024
5806de0
Extracted loaders to seperate modules.
pomek Sep 11, 2024
37c6046
Refactor.
pomek Sep 11, 2024
f176262
Migrated some tests.
przemyslaw-zan Sep 11, 2024
54ba4fa
Fixed issues with missing named exports from packages.
pomek Sep 12, 2024
d1ab850
Extracted all utils to separate modules.
pomek Sep 12, 2024
976f541
Fixed invalid re-exports.
pomek Sep 12, 2024
e767914
Added missing mocks.
pomek Sep 12, 2024
e7ef25b
Fixed logger re-exports to avoid BC.
pomek Sep 12, 2024
9efd9db
Build-tools: Added a missing dependency in a mocked package.
pomek Sep 12, 2024
4fa72f7
Make release scripts ready for ESM.
pomek Sep 12, 2024
d2fe470
Converted more tests.
przemyslaw-zan Sep 13, 2024
142744f
Migrated more tests.
przemyslaw-zan Sep 15, 2024
5dc5ce2
Finished package migration.
przemyslaw-zan Sep 15, 2024
ad94b8a
Merge pull request #1007 from ckeditor/ci/3757-utils
pomek Sep 16, 2024
33de152
Dev tests as ESM.
pomek Sep 16, 2024
b80ee01
Merge remote-tracking branch 'origin/ci/3766-transifex' into i/3765-t…
pomek Sep 16, 2024
a499070
Merge branch 'epic/3757-esm' into ci/3766-transifex
przemyslaw-zan Sep 16, 2024
e352edf
Support for running maunal tests.
pomek Sep 16, 2024
5d1f8e4
Support for a custom Karma configuratiom for an IntelliJ IDE.
pomek Sep 16, 2024
bdd79d9
CircleCI: Support for running package tests in separate steps.
pomek Sep 16, 2024
f895c81
Merge branch 'i/3772-esm-ready' into i/3765-tests
pomek Sep 16, 2024
74b3c3c
s/cwd/working_directory
pomek Sep 16, 2024
4de2f11
Review requests.
przemyslaw-zan Sep 16, 2024
6e451e2
Filter out packages without tests.
pomek Sep 16, 2024
a37d643
Merge pull request #1006 from ckeditor/ci/3766-transifex
pomek Sep 16, 2024
56af74d
Merge branch 'epic/3757-esm' into i/3765-tests
pomek Sep 16, 2024
9563123
First tests.
pomek Sep 16, 2024
2696d95
Tests for "runManualTests()".
pomek Sep 17, 2024
c9c067c
Converted attribute tests.
pomek Sep 17, 2024
14c8f2c
More tests.
pomek Sep 18, 2024
3488b63
Removed the `jsdoc-plugins` package.
psmyrek Sep 18, 2024
508743a
Aligned tests.
psmyrek Sep 18, 2024
7ee4e46
Even more tests.
pomek Sep 18, 2024
edd1a70
100% tests to Vitest.
pomek Sep 18, 2024
f713738
ESM for a script that updates licenses.
pomek Sep 18, 2024
890186e
Merge pull request #1010 from ckeditor/ci/3770
pomek Sep 19, 2024
5f7fddb
Merge branch 'epic/3757-esm' into i/3765-tests
pomek Sep 19, 2024
0aa7ab0
Replaced require with import (readline) for Windows.
pomek Sep 19, 2024
d89e126
Merge pull request #1009 from ckeditor/i/3765-tests
pomek Sep 19, 2024
ab5491d
Aligned to `ckeditor5-dev` ESM changes.
psmyrek Sep 19, 2024
5facca7
Reverted changes with `'@babel/eslint-parser'` as it does not work wi…
psmyrek Sep 19, 2024
09868f4
Merge pull request #1012 from ckeditor/ci/3772
pomek Sep 19, 2024
57ae04c
Fixed re-exports in ckeditor5-dev-web-crawler.
pomek Sep 20, 2024
020d138
Stale-bot: Fixed importing a configuration file.
pomek Sep 20, 2024
ac40805
Dependency checker: align to ESM changes (run-time check).
pomek Sep 20, 2024
6c6bffc
Temporary changes to enable alpha release from the `epic/3757-esm` br…
psmyrek Sep 20, 2024
1cc2de5
Merge pull request #1013 from ckeditor/ci/3774
pomek Sep 20, 2024
8871512
Docs: Changelog. [skip ci]
pomek Sep 20, 2024
e7181e7
Changelog for v44.0.0-alpha.
pomek Sep 20, 2024
f89ab93
Added missing method parameter to fetch calls.
pomek Sep 20, 2024
34396ba
Release tools: fixed npm publish callback.
pomek Sep 20, 2024
84a3759
Release: v'44.0.0-alpha.0'.
CKEditorBot Sep 20, 2024
980c0ed
ESLint@8.
pomek Sep 23, 2024
543af02
ckeditor5-dev-release-tools: use the latest compatible version of dep…
pomek Sep 23, 2024
fb1d106
ckeditor5-dev-build-tools: unified dependencies versioning across the…
pomek Sep 23, 2024
457eed5
ckeditor5-dev-bump-year: unified dependencies versioning across the r…
pomek Sep 23, 2024
0b36511
ckeditor5-dev-ci: unified dependencies versioning across the repository.
pomek Sep 23, 2024
bac1402
ckeditor5-dev-dependency-checker: unified dependencies versioning acr…
pomek Sep 23, 2024
986473b
ckeditor5-dev-docs: use the latest compatible version of dependencies.
pomek Sep 23, 2024
2bb12d3
ckeditor5-dev-stale-bot: use the latest compatible version of depende…
pomek Sep 23, 2024
8bb8542
ckeditor5-dev-tests: use the latest compatible version of dependencies.
pomek Sep 23, 2024
d2e6d4e
ckeditor5-dev-transifex: use the latest compatible version of depende…
pomek Sep 23, 2024
1f15d81
ckeditor5-dev-translations: use the latest compatible version of depe…
pomek Sep 23, 2024
04582a6
ckeditor5-dev-utils: use the latest compatible version of dependencies.
pomek Sep 23, 2024
6bf2e25
ckeditor5-dev-web-crawler: use the latest compatible version of depen…
pomek Sep 23, 2024
8506246
typedoc-plugins: use the latest compatible version of dependencies.
pomek Sep 23, 2024
d36e6e9
ckeditor5-dev: dependencies upgrade.
pomek Sep 23, 2024
8a7fe1a
Aligned code base after bumping deps in ckeditor5-dev-release-tools.
pomek Sep 23, 2024
7f0efc4
Aligned code base after bumping deps in ckeditor5-dev-tests.
pomek Sep 23, 2024
762b33e
Aligned code base after bumping deps in ckeditor5-dev-transifex.
pomek Sep 23, 2024
ff1df0b
Aligned code base after bumping deps in ckeditor5-dev-utils.
pomek Sep 23, 2024
689d99d
Restored missing nyc package in typedoc-plugins (tests).
pomek Sep 23, 2024
c584a84
Moved the "coveralls" package to install on CI as it is not needed lo…
pomek Sep 23, 2024
2358a19
Merge pull request #1014 from ckeditor/i/3773-upgrade-deps
pomek Sep 23, 2024
8b5078e
Feature (release-tools): Allow defining a main branch when generating…
pomek Sep 23, 2024
3598a5b
Define a main branch to generate the changelog entries correctly.
pomek Sep 23, 2024
9ea42c9
Docs: Changelog. [skip ci]
pomek Sep 23, 2024
033430b
Changelog for v44.0.0-alpha.1
pomek Sep 23, 2024
c4ab299
Release: v'44.0.0-alpha.1'.
CKEditorBot Sep 23, 2024
868a805
Addressed an issue with invalid commit names after wrapping an input …
pomek Sep 23, 2024
833ac92
Other (tests): Restored the previous version of Chai and sinon-chai p…
pomek Sep 23, 2024
3c85828
Other (docs): Support for passing an array of files to ignore when pr…
pomek Sep 23, 2024
ce3902d
Other: Use the "2021" edition as a default preset for CKEditor 5 file…
pomek Sep 23, 2024
54053c4
Changelog for v44.0.0-alpha.2.
pomek Sep 23, 2024
e271464
Release: v44.0.0-alpha.2.
CKEditorBot Sep 23, 2024
e94009a
Other (tests): Downgrade the "sinon" package as it is not compatible …
pomek Sep 23, 2024
d70d99f
Other (web-crawler): Aligned internals to the latest Puppeteer API.
pomek Sep 23, 2024
9ddc9b7
Changelog for 44.0.0-alpha.3.
pomek Sep 23, 2024
3b69ca6
Release: v44.0.0-alpha.3.
CKEditorBot Sep 23, 2024
15a8f79
Fix (tests): Prevent crashing the manual test server when reading a n…
pomek Sep 24, 2024
c89444e
Fix (web-crawler): Use `jsonValue()` method to get the serialized arg…
psmyrek Sep 24, 2024
707f70b
Changelog for 44.0.0-alpha.4.
pomek Sep 24, 2024
fafeb30
Release: v44.0.0-alpha.4.
CKEditorBot Sep 24, 2024
bc06926
Revert "Fix (web-crawler): Use `jsonValue()` method to get the serial…
pomek Sep 24, 2024
3c2df98
Other (web-crawler): Restored the previous version of the "puppeteer"…
pomek Sep 24, 2024
4a62989
Changelog for v44.0.0-alpha.5.
pomek Sep 24, 2024
0214817
Release: v44.0.0-alpha.5.
CKEditorBot Sep 24, 2024
1083ad7
Internal (release-tools): Escape the "mainBranch" option.
pomek Sep 24, 2024
e567631
Addressed ESLint issues.
pomek Sep 24, 2024
170d8c9
Lowercase simple types in JSDoc.
pomek Sep 24, 2024
8c485b8
Normalized concurrency to always be integer in `executeInParallel()`.
martnpaneq Sep 27, 2024
c6ffb35
Added tests for concurrency in `executeInParallel()`.
martnpaneq Sep 27, 2024
a090a62
Tests (release-tools): Restore a fs after executing tests.
pomek Sep 27, 2024
12aac75
Amended test in `executeInParallel()` to check odd core numbers as de…
martnpaneq Sep 27, 2024
e21aaa7
Merge branch 'epic/3757-esm' into ck/17025
pomek Sep 27, 2024
6127e07
Merge pull request #1015 from ckeditor/ck/17025
pomek Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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