A local-first personal finance app
update package versions with release action when explicit version passed (#6767)
Matt Fiddamand768cfa5086b
diff --git a/.github/workflows/generate-release-pr.yml b/.github/workflows/generate-release-pr.ymlindex 30c39497a3..76363c954d 100644--- a/.github/workflows/generate-release-pr.yml+++ b/.github/workflows/generate-release-pr.yml@@ -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)elseversion=$(node ./packages/ci-actions/bin/get-next-package-version.js \--package-json "./packages/$pkg/package.json" \diff --git a/packages/ci-actions/bin/get-next-package-version.js b/packages/ci-actions/bin/get-next-package-version.jsindex 7465a02022..99d5feb9aa 100755--- a/packages/ci-actions/bin/get-next-package-version.js+++ b/packages/ci-actions/bin/get-next-package-version.js@@ -19,6 +19,10 @@ const options = {type: 'string', // nightly, hotfix, monthly, autoshort: '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);diff --git a/upcoming-release-notes/6767.md b/upcoming-release-notes/6767.mdnew file mode 100644index 0000000000..1db299471d--- /dev/null+++ b/upcoming-release-notes/6767.md@@ -0,0 +1,6 @@+---+category: Bugfixes+authors: [matt-fidd]+---++Update package versions with release action when explicit version passed