Skip to content

Commit

Permalink
Include Bazel files in release archive
Browse files Browse the repository at this point in the history
  • Loading branch information
ileitch committed Aug 23, 2024
1 parent cffe42a commit 6fd4cde
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
13 changes: 13 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package_group(
name = "generated",
includes = [
"@periphery_generated//:package_group"
],
)

package_group(
name = "package_group",
packages = ["//..."],
)

alias(actual = "@periphery_generated//rule:scan", name = "scan")
2 changes: 1 addition & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Sources/ProjectDrivers/BazelProjectDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ public class BazelProjectDriver: ProjectDriver {
let buildPath = outputPath.appending("BUILD.bazel")
let deps = try queryTargets().joined(separator: ",\n")
let buildFileContents = """
load("@periphery//bazel/internal:scan.bzl", "scan")
load("@periphery//bazel/scan:scan.bzl", "scan")
scan(
name = "scan",
testonly = True,
config = "\(configPath)",
periphery_binary = "\(executablePath)",
visibility = [
"@periphery//bazel:package_group"
"@periphery//:package_group"
],
deps = [
\(deps)
Expand All @@ -123,7 +123,7 @@ public class BazelProjectDriver: ProjectDriver {
"run",
"--check_visibility=false",
"--ui_event_filters=-info,-debug,-warning",
"@periphery//bazel:scan",
"@periphery//:scan",
])

// The actual scan is performed by Bazel.
Expand Down
13 changes: 0 additions & 13 deletions bazel/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
package_group(
name = "generated",
includes = [
"@periphery_generated//:package_group"
],
)

package_group(
name = "package_group",
packages = ["//..."],
)

alias(actual = "@periphery_generated//rule:scan", name = "scan")
File renamed without changes.
2 changes: 1 addition & 1 deletion bazel/internal/scan.bzl → bazel/scan/scan.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ scan = rule(
"periphery_binary": attr.string(doc = "Path to the periphery binary."),
"_template": attr.label(
allow_single_file = True,
default = "@periphery//bazel/internal:scan_template.sh",
default = "@periphery//bazel/scan:scan_template.sh",
),
},
outputs = {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ codesign periphery

# Archive
zip_filename="periphery-${version}.zip"
zip "${zip_filename}" periphery LICENSE.md
zip -r "${zip_filename}" periphery LICENSE.md MODULE.bazel BUILD.bazel bazel
codesign "${zip_filename}"

echo -e "\n${zip_filename} checksum:"
Expand Down Expand Up @@ -101,7 +101,7 @@ if [[ $version == *"beta"* ]]; then
fi

cd ..
gh release create "--latest=${is_latest}" -F .release/release_notes.md "${version}" ".release/${zip_filename}" ".release/${zip_artifactbundle}"
gh release create --latest="${is_latest}" -F .release/release_notes.md "${version}" ".release/${zip_filename}" ".release/${zip_artifactbundle}"

# Homebrew
if [ $is_latest = false ]; then
Expand Down

0 comments on commit 6fd4cde

Please sign in to comment.