Squashed commit of the following:

commit 8928e6438277995f7167e400d4d77657a0ab0113
Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
Date:   Fri Jul 25 18:25:13 2025 +0800

    feat: add release step to development workflow for versioning

commit 14085c4f7c8943669fdacae3bd2b6a07c0c0389a
Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
Date:   Fri Jul 25 18:19:36 2025 +0800

    feat: add release commands for autobuild and deploytest to package.json and update version script
This commit is contained in:
Tunglies
2025-07-25 18:25:40 +08:00
Unverified
parent 8d0af75145
commit df5897c908
3 changed files with 14 additions and 2 deletions

View File

@@ -6,15 +6,17 @@
*
* <version> can be:
* - A full semver version (e.g., 1.2.3, v1.2.3, 1.2.3-beta, v1.2.3+build)
* - A tag: "alpha", "beta", "rc", or "autobuild"
* - A tag: "alpha", "beta", "rc", "autobuild", or "deploytest"
* - "alpha", "beta", "rc": Appends the tag to the current base version (e.g., 1.2.3-beta)
* - "autobuild": Appends a timestamped autobuild tag (e.g., 1.2.3+autobuild.2406101530)
* - "deploytest": Appends a timestamped deploytest tag (e.g., 1.2.3+deploytest.2406101530)
*
* Examples:
* pnpm release-version 1.2.3
* pnpm release-version v1.2.3-beta
* pnpm release-version beta
* pnpm release-version autobuild
* pnpm release-version deploytest
*
* The script will:
* - Validate and normalize the version argument
@@ -214,7 +216,7 @@ async function main(versionArg) {
try {
let newVersion;
const validTags = ["alpha", "beta", "rc", "autobuild"];
const validTags = ["alpha", "beta", "rc", "autobuild", "deploytest"];
if (validTags.includes(versionArg.toLowerCase())) {
const currentVersion = await getCurrentVersion();
@@ -223,6 +225,9 @@ async function main(versionArg) {
if (versionArg.toLowerCase() === "autobuild") {
// 格式: 2.3.0+autobuild.250613.cc39b27
newVersion = `${baseVersion}+autobuild.${generateShortTimestamp(true)}`;
} else if (versionArg.toLowerCase() === "deploytest") {
// 格式: 2.3.0+deploytest.250613.cc39b27
newVersion = `${baseVersion}+deploytest.${generateShortTimestamp(true)}`;
} else {
newVersion = `${baseVersion}-${versionArg.toLowerCase()}`;
}