From 7787b0c29068f3f8d7e935e6465cfe00058337a6 Mon Sep 17 00:00:00 2001 From: incredimo Date: Sun, 17 Mar 2024 01:47:40 +0400 Subject: [PATCH] =?UTF-8?q?=E2=89=A1=C6=92=C3=9C=C3=87=20Bump=20version=20?= =?UTF-8?q?to=20..1=20(2024-03-17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bump.moto | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 bump.moto diff --git a/bump.moto b/bump.moto new file mode 100644 index 0000000..4da9605 --- /dev/null +++ b/bump.moto @@ -0,0 +1,39 @@ + +task bump { +cd .. +$versionParts = $versionLine.Split('.') +$major = $versionParts[0] +$minor = $versionParts[1] +$patch = [int]$versionParts[2] + + +$patch += 1 + +# Construct the new version string +$newVersion = "$major.$minor.$patch" +$newCargoTomlContent = $cargoTomlContent -replace ('version = "' + [regex]::Escape($versionLine) + '"'), ('version = "' + $newVersion + '"') +Set-Content -Path $cargoTomlPath -Value $newCargoTomlContent + +Write-Output "✅ Updated version to $newVersion in Cargo.toml" + +$publishDate = Get-Date -Format "yyyy-MM-dd" + +$commitMessage = "🚀 Bump version to $newVersion ($publishDate)" +$releaseMessage = "Release v$newVersion ($publishDate)" + +git add . + +git commit -m "$commitMessage" + +git tag -a "v$newVersion" -m "$releaseMessage" + +Write-Output "🎉 Pushing changes and tags to the repository..." +git push && git push --tags + +Write-Output "📦 Publishing package to crates.io..." +cargo publish + +if ($LASTEXITCODE -eq 0) { Write-Output "✨ Package successfully published to crates.io!" } else { Write-Output "❌ Failed to publish package to crates.io."} + +Write-Output "🎉 Release v$newVersion completed!" +}:ps \ No newline at end of file