Skip to content

Commit

Permalink
Use Risor for the release script
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiojr committed Sep 25, 2024
1 parent 6482287 commit 8693a62
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions script/release
Original file line number Diff line number Diff line change
@@ -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 <version>")
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')

0 comments on commit 8693a62

Please sign in to comment.