Skip to content

Commit

Permalink
chore: simplify releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Jul 27, 2024
1 parent 1249af7 commit 711ec20
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 92 deletions.
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports_files([
"biome.json",
])

#ifndef _BZLPARTY_RELEASE_
formatter(
name = "format",
config = ":formatter.json",
Expand Down Expand Up @@ -51,3 +52,4 @@ formatter_test(
"@buildifier_prebuilt//:buildifier": "buildifier",
},
)
#endif
41 changes: 20 additions & 21 deletions scripts/release/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ load(
"url_flag",
"versioned_module_bazel",
)
load(":defs.bzl", "root_build_file", "toolchains_build_file")

sh_binary(
name = "copy_assets",
Expand Down Expand Up @@ -39,30 +38,22 @@ release_tag(
build_setting_default = "main",
)

cmd_assets(
name = "sha_assets",
binary = "sha",
[cmd_assets(
name = "%s_assets" % cmd,
binary = cmd,
integrity_map = {
"//cmd/sha:sha_%s_sha384" % p: p
"//cmd/%s:%s_%s_sha384" % (cmd, cmd, p): p
for p in PLATFORMS.keys()
},
url_flag = "//scripts/release:asset_url",
)

cmd_assets(
name = "templ_assets",
binary = "templ",
integrity_map = {
"//cmd/templ:templ_%s_sha384" % p: p
for p in PLATFORMS.keys()
},
url_flag = "//scripts/release:asset_url",
)
) for cmd in [
"sha",
"templ",
]]

versioned_module_bazel(
name = "versioned_module_bazel",
out = "versioned_MODULE.bazel",
tags = ["manual"],
version = ":release_tag",
)

Expand All @@ -71,20 +62,28 @@ dcomment(
src = ":versioned_module_bazel",
out = "root_MODULE.bazel",
defines = "_BZLPARTY_RELEASE_",
tags = ["manual"],
)

dcomment(
name = "docs_build_bazel",
src = "//docs:BUILD.bazel",
out = "docs_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
tags = ["manual"],
)

root_build_file(name = "root_build_bazel")
dcomment(
name = "root_build_bazel",
src = "//:BUILD.bazel",
out = "root_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
)

toolchains_build_file(name = "toolchains_build_bazel")
dcomment(
name = "toolchains_build_bazel",
src = "//toolchains:BUILD.bazel",
out = "toolchains_BUILD.bazel",
defines = "_BZLPARTY_RELEASE_",
)

git_archive(
name = "git_archive",
Expand Down
69 changes: 0 additions & 69 deletions scripts/release/defs.bzl

This file was deleted.

6 changes: 4 additions & 2 deletions toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ load(":toolchains.bzl", "bzlparty_toolchains")

package(default_visibility = ["//visibility:public"])

bzlparty_toolchains()

#ifndef _BZLPARTY_RELEASE_
TOOLS = [
"biome",
"fd",
Expand All @@ -29,6 +32,7 @@ create_bzl_file(
template = "toolchains",
tools = TOOLS,
)
#endif

bzl_library(
name = "external",
Expand All @@ -42,5 +46,3 @@ bzl_library(
"//lib:resolved_toolchains",
],
)

bzlparty_toolchains()

0 comments on commit 711ec20

Please sign in to comment.