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 0ada23e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 21 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.
9 changes: 6 additions & 3 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ mkdir .release
cat scripts/Version.swift.template | sed s/__VERSION__/${version}/ > Sources/Frontend/Version.swift
cat scripts/artifactbundle_info.json.template | sed s/__VERSION__/${version}/ > .release/info.json

cp LICENSE.md .release/
cp scripts/release_notes.md.template .release/release_notes.md
cp BUILD.bazel MODULE.bazel .release
cp -R bazel .release

echo -e "\nUpdate CHANGELOG.md"
confirm "Continue?"

bin_path=$(make show_bin_path)
rm -rf "$bin_path"
make build_release
cp "$bin_path" .release/
cp LICENSE.md .release/
cp scripts/release_notes.md.template .release/release_notes.md

# Codesign
cd .release
Expand Down Expand Up @@ -101,7 +104,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 0ada23e

Please sign in to comment.