-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup CI/CD for v53 legacy branch (#3705)
- Loading branch information
1 parent
9a6b436
commit 096b300
Showing
5 changed files
with
29 additions
and
23 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 |
---|---|---|
|
@@ -22,6 +22,7 @@ import getLastTag from './getLastTag.mjs'; | |
const VERSION_PREFIX = 'v'; | ||
const PATH = '.'; | ||
const BUMP_TYPES = ['major', 'minor', 'patch', 'prerelease']; | ||
const DEFAULT_BRANCH = 'master'; | ||
|
||
/** | ||
* @param options Optional options to use when publishing | ||
|
@@ -30,12 +31,10 @@ const BUMP_TYPES = ['major', 'minor', 'patch', 'prerelease']; | |
* * `branch: string`: Branch name used to publish the new version (default `"master"`) | ||
* * `bump: BUMP_TYPES`: Force a specific version bump instead of relying on the commit message | ||
*/ | ||
export default async ({github, context, exec}, { | ||
dry = false, | ||
tag = 'latest', | ||
branch = 'master', | ||
bump = null | ||
} = {}) => { | ||
export default async ( | ||
{github, context, exec}, | ||
{dry = false, tag = 'latest', branch = DEFAULT_BRANCH, bump = null} = {}, | ||
) => { | ||
const GIT_USERNAME = 'coveobot'; | ||
const GIT_EMAIL = '[email protected]'; | ||
const GIT_SSH_REMOTE = 'deploy'; | ||
|
@@ -66,14 +65,18 @@ export default async ({github, context, exec}, { | |
bumpInfo = convention.recommendedBumpOpts.whatBump(parsedCommits); | ||
} | ||
|
||
if (bumpInfo.type === 'major' && branch !== DEFAULT_BRANCH) { | ||
throw new Error(`Cannot bump a major version on a branch other than ${DEFAULT_BRANCH}`); | ||
} | ||
|
||
const currentVersion = lastTag.replace(VERSION_PREFIX, ''); | ||
const newVersion = getNextVersion(currentVersion, bumpInfo); | ||
|
||
if (newVersion !== currentVersion) { | ||
console.info('Bumping %s to version %s', changedPackages.join(', '), newVersion); | ||
await pnpmBumpVersion(newVersion, lastTag, ['root']); | ||
|
||
let changelog = '' | ||
let changelog = ''; | ||
if (parsedCommits.length > 0) { | ||
changelog = await generateChangelog( | ||
parsedCommits, | ||
|
@@ -82,7 +85,7 @@ export default async ({github, context, exec}, { | |
...context.repo, | ||
host: 'https://github.com', | ||
}, | ||
convention.writerOpts | ||
convention.writerOpts, | ||
); | ||
await writeChangelog(PATH, changelog); | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
name: 'Dependency Review' | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master", next ] | ||
pull_request: | ||
branches: ['master', 'next', 'v53'] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
dependency-Review: | ||
name: Review | ||
uses: coveo/public-actions/.github/workflows/dependency-review.yml@main | ||
with: | ||
public: true | ||
distributed: true | ||
dependency-Review: | ||
name: Review | ||
uses: coveo/public-actions/.github/workflows/dependency-review.yml@main | ||
with: | ||
public: true | ||
distributed: true |