Skip to content

Commit

Permalink
Merge pull request #3825 from greymistcube/chore/fix-javascript-ci
Browse files Browse the repository at this point in the history
👷 Updated javascript ci version parsing
  • Loading branch information
greymistcube authored Jun 13, 2024
2 parents 7bbce0e + 8429b9e commit aa6c4a2
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions scripts/determine-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,29 @@ async function main() {
versionSuffix += `+${commitHash}`;
versionType = "nightly";
} else if (tag != null) {
// Release
if (tag !== versionPrefix) {
// Tagged
if (tag === versionPrefix) {
// Release
packageVersion = tag;
versionType = "stable";
} else if (tag.startsWith(versionPrefix)) {
// Prerelease
packageVersion = tag;
delimIndex = tag.indexOf("-");
versionSuffix = tag.substring(delimIndex + 1);
versionType = "prerelease";
if (delimIndex < 0 || !versionSuffix) {
console.error(
`Git tag (${tag}) is not in a proper format for prerelease`,
);
process.exit(1);
}
} else {
console.error(
`Git tag (${tag}) does not match VersionPrefix (${versionPrefix})`,
`Git tag (${tag}) does not contain VersionPrefix (${versionPrefix})`,
);
process.exit(1);
}
packageVersion = tag;
versionType = "stable";
} else {
// Dev
const timestamp = await getCommitTimestamp();
Expand Down

0 comments on commit aa6c4a2

Please sign in to comment.