-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1019 from ckeditor/i/3828-restartable-release
Feature (ci): Created a new binary script called `ckeditor5-dev-ci-is-workflow-restarted` that returns with a non-zero exit code if a given workflow is executed for the first time. The restarted workflows exit with a zero exit code. Feature (release-tools): A user-provided version will be checked against npm availability while generating a changelog. If it is already taken, the tools will not allow it to be used. Other (release-tools): The `updateVersions()` task will no longer verify if the specified `version` is available on npm. Other (release-tools): The `publishPackages()` task filters out already published packages to avoid pushing the same archive twice. Thanks to that, it can be a part of a process that would be restarted. Other (release-tools): The `publishPackages()` task tries to publish the package once again when it fails independently from the returned error code. Previously, it was scheduled only when the `E409` error occurred. Other (release-tools): The `verifyPackagesPublishedCorrectly()` task is no longer available as its responsibility has been merged into the `publishPackages()` task. Other (release-tools): The `commitAndTag()` task does not commit files if a tag for the specified version is already created.
- Loading branch information
Showing
30 changed files
with
1,187 additions
and
901 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
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,46 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/* eslint-env node */ | ||
|
||
/** | ||
* This script checks if the provided workflow has been restarted. If so, it exits with a zero error code. | ||
* | ||
* In order to integrate the action in your pipeline, you need prepare a few environment variables: | ||
* | ||
* - CIRCLE_WORKFLOW_ID - provided by default by CircleCI and keeps the workflow id. | ||
* - CKE5_CIRCLE_TOKEN - an authorization token to talk to CircleCI REST API. | ||
* | ||
* Example usage: | ||
* CKE5_CIRCLE_TOKEN=... ckeditor5-dev-ci-is-workflow-restarted | ||
*/ | ||
|
||
const { | ||
CKE5_CIRCLE_TOKEN, | ||
CIRCLE_WORKFLOW_ID | ||
} = process.env; | ||
|
||
const requestUrl = `https://circleci.com/api/v2/workflow/${ CIRCLE_WORKFLOW_ID }`; | ||
|
||
const requestOptions = { | ||
method: 'GET', | ||
headers: { | ||
'Circle-Token': CKE5_CIRCLE_TOKEN | ||
} | ||
}; | ||
|
||
fetch( requestUrl, requestOptions ) | ||
.then( res => res.json() ) | ||
.then( response => { | ||
const { tag = '' } = response; | ||
|
||
if ( tag.startsWith( 'rerun' ) ) { | ||
return process.exit( 0 ); | ||
} | ||
|
||
return process.exit( 1 ); | ||
} ); |
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
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
Oops, something went wrong.