Skip to content

Commit

Permalink
🚀 Bump version to ..1 (2024-03-17)
Browse files Browse the repository at this point in the history
  • Loading branch information
incredimo committed Mar 16, 2024
1 parent 99c743b commit 7787b0c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions bump.moto
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7787b0c

Please sign in to comment.