diff --git a/common/cli.json b/common/cli.json index 84b7a99c..e2d799e7 100644 --- a/common/cli.json +++ b/common/cli.json @@ -6,7 +6,6 @@ "darwin_arm64": "23383d46ea5f2c92719f4d31581e1672dde6f9dc52df00c87be603ed1181b6ab", "darwin_x86_64": "6e38b4ea3d59c5e517ce2b5c530fb373acccacff311fbfca283c293e2dfee51c", "windows_arm64": "eec404334deea68e6f0efffc12e6bd0ff516c1aa9bdd327bb4ef1e0b4d415bab", - "linux_x86_64": "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886", - "darwin_all": "698751833e9ed3203264e8078e109f89a2a393b8dd4c16526c18b59a639b745c" + "linux_x86_64": "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886" } } \ No newline at end of file diff --git a/common/qodana.ts b/common/qodana.ts index 5fcbd74f..5aaeb957 100644 --- a/common/qodana.ts +++ b/common/qodana.ts @@ -28,8 +28,6 @@ export function getQodanaSha256(arch: string, platform: string): string { return checksum['linux_x86_64'] case 'linux_arm64': return checksum['linux_arm64'] - case 'darwin_all': - return checksum['darwin_all'] default: throw new Error(`Qodana CLI does not exist for ${platform}_${arch}`) } diff --git a/common/update-cli.js b/common/update-cli.js index 13cf9d40..66934726 100644 --- a/common/update-cli.js +++ b/common/update-cli.js @@ -76,7 +76,7 @@ async function getLatestRelease() { }; const release = await makeRequest(options); - return release.tag_name; + return release.tag_name.substring(1); } catch (error) { console.error("An error occurred:", error); } @@ -96,7 +96,7 @@ function updateCliChecksums(latestVersion, checksumsPath, cliJsonPath) { } } }); - cliJson.version = latestVersion.slice(1); + cliJson.version = latestVersion; fs.writeFileSync(cliJsonPath, JSON.stringify(cliJson, null, 2)); fs.unlinkSync(checksumsPath); } @@ -114,8 +114,6 @@ function updateCircleCIChecksums(circleCIConfigPath) { } function updateVersions(latestVersion, currentVersion) { - latestVersion = latestVersion.slice(1); - const latestVersions = latestVersion.split("."); const latestMajor = parseInt(latestVersions[0]); const latestMinor = parseInt(latestVersions[1]); @@ -137,27 +135,33 @@ function updateVersions(latestVersion, currentVersion) { const currentVersions = currentVersion.split("."); const currentMajor = parseInt(currentVersions[0]); const currentMinor = parseInt(currentVersions[1]); + const currentPatch = parseInt(currentVersions[2]); - replaceStringsInProject(`${latestMajor}.${latestMinor}.${latestPatch}`, `${currentMajor}.${currentMinor}.${latestPatch}`); + replaceStringsInProject(`${latestMajor}.${latestMinor}.${latestPatch}`, `${currentMajor}.${currentMinor}.${currentPatch}`); replaceStringsInProject(`${latestMajor}.${latestMinor}`, `${currentMajor}.${currentMinor}`); + replaceStringsInProject(`${latestMajor}`, `${currentMajor}`); } function replaceStringsInProject(newString, oldString) { process.env.LC_ALL = "C"; const isMacOS = process.platform === "darwin"; const command = `cd .. && find . -type f -exec sed -i${isMacOS ? " ''" : ""} 's/${oldString}/${newString}/g' {} +`; + console.log("Running command:", command); execSync(command, { shell: "/bin/bash" }); } async function main() { try { const currentVersion = JSON.parse(fs.readFileSync(cliJsonPath, "utf-8")).version; + console.log("Current version:", currentVersion); const latestVersion = await getLatestRelease(); + console.log("Latest version:", latestVersion); + console.log("Downloading new checksums..."); await downloadFile(`https://github.com/jetbrains/qodana-cli/releases/latest/download/checksums.txt`, "checksums.txt"); updateVersions(latestVersion, currentVersion); updateCliChecksums(latestVersion, "checksums.txt", cliJsonPath); updateCircleCIChecksums("../orb/commands/scan.yml"); - console.log("Checksums updated successfully!"); + console.log("Versions updated successfully!"); } catch (error) { console.error("An error occurred:", error); } diff --git a/scan/dist/index.js b/scan/dist/index.js index 20fbb47f..ff02408c 100644 --- a/scan/dist/index.js +++ b/scan/dist/index.js @@ -24283,8 +24283,7 @@ var init_cli = __esm({ darwin_arm64: "23383d46ea5f2c92719f4d31581e1672dde6f9dc52df00c87be603ed1181b6ab", darwin_x86_64: "6e38b4ea3d59c5e517ce2b5c530fb373acccacff311fbfca283c293e2dfee51c", windows_arm64: "eec404334deea68e6f0efffc12e6bd0ff516c1aa9bdd327bb4ef1e0b4d415bab", - linux_x86_64: "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886", - darwin_all: "698751833e9ed3203264e8078e109f89a2a393b8dd4c16526c18b59a639b745c" + linux_x86_64: "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886" }; } }); @@ -24331,8 +24330,6 @@ function getQodanaSha256(arch, platform) { return checksum["linux_x86_64"]; case "linux_arm64": return checksum["linux_arm64"]; - case "darwin_all": - return checksum["darwin_all"]; default: throw new Error(`Qodana CLI does not exist for ${platform}_${arch}`); } diff --git a/vsts/QodanaScan/index.js b/vsts/QodanaScan/index.js index d07a7236..adf2ab42 100644 --- a/vsts/QodanaScan/index.js +++ b/vsts/QodanaScan/index.js @@ -44,8 +44,7 @@ var init_cli = __esm({ darwin_arm64: "23383d46ea5f2c92719f4d31581e1672dde6f9dc52df00c87be603ed1181b6ab", darwin_x86_64: "6e38b4ea3d59c5e517ce2b5c530fb373acccacff311fbfca283c293e2dfee51c", windows_arm64: "eec404334deea68e6f0efffc12e6bd0ff516c1aa9bdd327bb4ef1e0b4d415bab", - linux_x86_64: "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886", - darwin_all: "698751833e9ed3203264e8078e109f89a2a393b8dd4c16526c18b59a639b745c" + linux_x86_64: "08641aed84e7cb9d422feabbaa60034322f3471d3ae7f5c7b04da0b766981886" }; } }); @@ -92,8 +91,6 @@ function getQodanaSha256(arch, platform) { return checksum["linux_x86_64"]; case "linux_arm64": return checksum["linux_arm64"]; - case "darwin_all": - return checksum["darwin_all"]; default: throw new Error(`Qodana CLI does not exist for ${platform}_${arch}`); }