-
Notifications
You must be signed in to change notification settings - Fork 26
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 #969 from ckeditor/i/3710-release-via-ci
Feature (ci): Created a new binary (`ckeditor5-dev-ci-is-job-triggered-by-member`) script to check if a team member approved a CI job. Feature (ci): Created a new binary (`ckeditor5-dev-ci-trigger-circle-build`) script to trigger a new pipeline on CircleCI. Feature (ci): Created new binary (`ckeditor5-dev-ci-circle-disable-auto-cancel-builds`, `ckeditor5-dev-ci-circle-enable-auto-cancel-builds`) scripts to update the redundant workflows option on CircleCI. Internal: Integrate the release process via CI in the repository.
- Loading branch information
Showing
24 changed files
with
1,162 additions
and
40 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
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
49 changes: 49 additions & 0 deletions
49
packages/ckeditor5-dev-ci/bin/circle-disable-auto-cancel-builds.js
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,49 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const circleUpdateAutoCancelBuilds = require( '../lib/circle-update-auto-cancel-builds' ); | ||
|
||
/** | ||
* This script updates CircleCI settings to disable the "Auto-cancel redundant workflows" option. | ||
* | ||
* It's needed when triggering a release process via CI to avoid canceling the release workflow by pushing | ||
* a new commit (the released one) that will trigger a new pipeline. | ||
* | ||
* In order to integrate the action in your pipeline, you need prepare a few environment variables: | ||
* | ||
* - CKE5_CIRCLE_TOKEN - an authorization token to talk to CircleCI REST API. | ||
* - CKE5_GITHUB_ORGANIZATION - your GitHub organization. | ||
* - CKE5_GITHUB_REPOSITORY - your GitHub repository. | ||
* | ||
* Example usage: | ||
* CKE5_CIRCLE_TOKEN=... ckeditor5-dev-ci-circle-disable-auto-cancel-builds | ||
*/ | ||
|
||
const { | ||
CKE5_CIRCLE_TOKEN, | ||
CKE5_GITHUB_ORGANIZATION, | ||
CKE5_GITHUB_REPOSITORY | ||
} = process.env; | ||
|
||
const options = { | ||
circleToken: CKE5_CIRCLE_TOKEN, | ||
githubOrganization: CKE5_GITHUB_ORGANIZATION, | ||
githubRepository: CKE5_GITHUB_REPOSITORY, | ||
newValue: false | ||
}; | ||
|
||
circleUpdateAutoCancelBuilds( options ) | ||
.then( () => { | ||
console.log( 'Auto-cancel redundant workflows is now disabled.' ); | ||
} ) | ||
.catch( err => { | ||
console.error( err ); | ||
|
||
process.exit( 1 ); | ||
} ); |
49 changes: 49 additions & 0 deletions
49
packages/ckeditor5-dev-ci/bin/circle-enable-auto-cancel-builds.js
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,49 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const circleUpdateAutoCancelBuilds = require( '../lib/circle-update-auto-cancel-builds' ); | ||
|
||
/** | ||
* This script updates CircleCI settings to enable the "Auto-cancel redundant workflows" option. | ||
* | ||
* It should be done only if a release workflow uses the `ckeditor5-dev-ci-circle-disable-auto-cancel-builds` | ||
* script to disable the same option. | ||
* | ||
* In order to integrate the action in your pipeline, you need prepare a few environment variables: | ||
* | ||
* - CKE5_CIRCLE_TOKEN - an authorization token to talk to CircleCI REST API. | ||
* - CKE5_GITHUB_ORGANIZATION - your GitHub organization. | ||
* - CKE5_GITHUB_REPOSITORY - your GitHub repository. | ||
* | ||
* Example usage: | ||
* CKE5_CIRCLE_TOKEN=... ckeditor5-dev-ci-circle-enable-auto-cancel-builds | ||
*/ | ||
|
||
const { | ||
CKE5_CIRCLE_TOKEN, | ||
CKE5_GITHUB_ORGANIZATION, | ||
CKE5_GITHUB_REPOSITORY | ||
} = process.env; | ||
|
||
const options = { | ||
circleToken: CKE5_CIRCLE_TOKEN, | ||
githubOrganization: CKE5_GITHUB_ORGANIZATION, | ||
githubRepository: CKE5_GITHUB_REPOSITORY, | ||
newValue: true | ||
}; | ||
|
||
circleUpdateAutoCancelBuilds( options ) | ||
.then( () => { | ||
console.log( 'Auto-cancel redundant workflows is now enabled.' ); | ||
} ) | ||
.catch( err => { | ||
console.error( err ); | ||
|
||
process.exit( 1 ); | ||
} ); |
Oops, something went wrong.