task bump { cd .. $cargoTomlPath = "./Cargo.toml" $cargoTomlContent = Get-Content -Path $cargoTomlPath -Raw $matched = $cargoTomlContent -match 'version = "([^"]+)"' if (-Not $matched) { Write-Output "❌ Version line not found in Cargo.toml" Write-Output "Please ensure the Cargo.toml file contains a valid version line." exit 1 } $versionLine = $matches[1] $versionParts = $versionLine.Split('.') $major = $versionParts[0] $minor = $versionParts[1] $patch = [int]$versionParts[2] $patch += 1 $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) and release 📦" $releaseMessage = "Release v$newVersion ($publishDate)" # Add ALL files to git 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 --quiet if ($LASTEXITCODE -eq 0) { Write-Output "✨ successfully published to crates.io" } else { Write-Output "❌ Failed to publish package to crates.io." Write-Output "Please check the output above for more details." } Write-Output "🎉 Release v$newVersion completed!" }:ps