diff --git a/script/release b/script/release index c6db1fd..db74029 100755 --- a/script/release +++ b/script/release @@ -1,13 +1,23 @@ -#!/bin/sh -set -e - -if [ -z "$1" ]; then - echo "Missing version." - exit 1 -fi - -go build cmd/omnivore/... -git commit -am "Tagging $1" -git push -git tag "$1" -git push --tags +#!/usr/bin/env -S risor --modules ${HOME}/.local/share/rsx/modules/ -- +import rsx +import regexp +import exec + +if len(os.args()) < 2 { + print("Usage: release ") + os.exit(1) +} +version := os.args()[1] + +const r = `v\d\.\d\.\d` + +if !regexp.match(r, version) { + print("Invalid version: " + version) + os.exit(1) +} + +rsx.replace_in("cmd/omnivore/main.go", r, version) +rsx.shell('git commit -m "bump version to {version}" cmd/omnivore') +rsx.shell('git tag {version}') +rsx.shell('git push') +rsx.shell('git push --tags')