Skip to content

Commit

Permalink
chore: add release target
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Jun 26, 2023
1 parent 09f5b40 commit 36db490
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("//tools:defs.bzl", "push_tag")

push_tag(name = "release")

gazelle_binary(
name = "gazelle_bin",
Expand Down
8 changes: 8 additions & 0 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

bzl_library(
name = "defs",
srcs = ["defs.bzl"],
visibility = ["//visibility:public"],
deps = ["@bazel_skylib//rules:write_file"],
)
18 changes: 18 additions & 0 deletions tools/defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"Tools"

load("@bazel_skylib//rules:write_file.bzl", "write_file")

def push_tag(name):
write_file(
name = name,
out = "%s.sh" % name,
content = [
"#!/usr/bin/env bash",
"cd $BUILD_WORKSPACE_DIRECTORY",
"""echo "Current tag: $(git tag -l | tail -1)" """,
"read -p 'Enter tag: ' tag",
"read -p 'Enter message: ' message",
"""git tag --annotate "$tag" --message "$message" && git push --all""",
],
is_executable = True,
)

0 comments on commit 36db490

Please sign in to comment.