-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): add engine versions to release (#30021)
- Loading branch information
1 parent
4f7e11c
commit f93648a
Showing
5 changed files
with
66 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/release-action': minor | ||
--- | ||
|
||
Add back "Engine Versions" to the release notes |
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,41 @@ | ||
import { readFile } from 'fs/promises'; | ||
import path from 'path'; | ||
|
||
import { getExecOutput } from '@actions/exec'; | ||
|
||
import { readPackageJson } from './utils'; | ||
|
||
export async function getMongoVersion(cwd: string) { | ||
try { | ||
const workflows = await readFile(path.join(cwd, '.github/workflows/ci.yml'), 'utf8'); | ||
|
||
const mongoMatch = workflows.match(/compatibleMongoVersions\\": \[([^\]]+)\]/); | ||
if (!mongoMatch) { | ||
return []; | ||
} | ||
|
||
return mongoMatch[1].replace(/["'\\ ]/g, '').split(','); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
return []; | ||
} | ||
|
||
export async function getNodeNpmVersions(cwd: string): Promise<{ node: string; yarn: string; npm: string }> { | ||
const packageJson = await readPackageJson(cwd); | ||
|
||
return packageJson.engines; | ||
} | ||
|
||
export async function getAppsEngineVersion() { | ||
try { | ||
const result = await getExecOutput('yarn why @rocket.chat/apps-engine --json'); | ||
|
||
const match = result.stdout.match(/"@rocket\.chat\/meteor@workspace:apps\/meteor".*"@rocket\.chat\/apps\-engine@[^#]+#npm:([^"]+)"/); | ||
if (match) { | ||
return match[1]; | ||
} | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
} |
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