update package versions with release action when explicit version passed (#6767)

* update package versions when explicit version passed

* note
This commit is contained in:
Matt Fiddaman
2026-01-24 15:30:17 +00:00
committed by GitHub
parent e0ed53c4af
commit d768cfa508
3 changed files with 28 additions and 10 deletions

View File

@@ -35,7 +35,10 @@ jobs:
pkg="${packages[$key]}"
if [[ -n "${{ github.event.inputs.version }}" ]]; then
version="${{ github.event.inputs.version }}"
version=$(node ./packages/ci-actions/bin/get-next-package-version.js \
--package-json "./packages/$pkg/package.json" \
--version "${{ github.event.inputs.version }}" \
--update)
else
version=$(node ./packages/ci-actions/bin/get-next-package-version.js \
--package-json "./packages/$pkg/package.json" \

View File

@@ -19,6 +19,10 @@ const options = {
type: 'string', // nightly, hotfix, monthly, auto
short: 't',
},
version: {
type: 'string',
short: 'v',
},
update: {
type: 'boolean',
short: 'u',
@@ -44,16 +48,21 @@ try {
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
const currentVersion = packageJson.version;
const explicitVersion = values.version;
let newVersion;
try {
newVersion = getNextVersion({
currentVersion,
type: values.type,
currentDate: new Date(),
});
} catch (e) {
console.error(e.message);
process.exit(1);
if (explicitVersion) {
newVersion = explicitVersion;
} else {
try {
newVersion = getNextVersion({
currentVersion,
type: values.type,
currentDate: new Date(),
});
} catch (e) {
console.error(e.message);
process.exit(1);
}
}
process.stdout.write(newVersion);

View File

@@ -0,0 +1,6 @@
---
category: Bugfixes
authors: [matt-fidd]
---
Update package versions with release action when explicit version passed