Skip to content

Commit

Permalink
chore: include the examples in the release artifact (#37)
Browse files Browse the repository at this point in the history
Summary:
- chore: package the examples with the distribution tarball
- chore: set the MODULE.bazel version to 0
  • Loading branch information
aignas authored Jan 10, 2024
1 parent 40f6bee commit b4e2fc8
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
examples
examples/check_glob/bazel-bin
examples/check_glob/bazel-out
examples/check_glob/bazel-testlogs
examples/check_glob/bazel-optional_attributes

examples/optional_attributes/bazel-bin
examples/optional_attributes/bazel-out
examples/optional_attributes/bazel-testlogs
examples/optional_attributes/bazel-optional_attributes
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ common --incompatible_strict_action_env
common --enable_bzlmod

try-import user.bazelrc

# To update these lines, execute
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
build --deleted_packages=examples/check_glob,examples/optional_attributes
query --deleted_packages=examples/check_glob,examples/optional_attributes
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
bcr_test_module:
module_path: "examples/bzlmod"
module_path: "examples/check_glob"
matrix:
platform: ["debian10", "macos", "ubuntu2004"]
tasks:
Expand Down
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ filegroup(
":def.bzl",
":deps.bzl",
"//internal:distribution",
# Needed for BCR registry to run the pre-submit tests
"//examples:distribution",
],
visibility = ["//internal/pkg:__pkg__"],
)
Expand Down
9 changes: 8 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_shellcheck",
version = "0.2.4",
version = "0.0.0",
compatibility_level = 1,
)

Expand All @@ -17,4 +17,11 @@ use_repo(
"shellcheck_windows_x86_64",
)

# Dev dependencies

bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)
bazel_dep(
name = "rules_bazel_integration_test",
version = "0.21.0",
dev_dependency = True,
)
4 changes: 4 additions & 0 deletions ci/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ main() {
_log "Extracting the tarball into a temporary directory to run examples"
tar -xvf "$tarball" -C "$TMPDIR"

pushd $TMPDIR

# Then run examples with the packaged artifacts
examples=(
check_glob
Expand All @@ -41,6 +43,8 @@ main() {
...
popd
done

popd
_log "Success"
}

Expand Down
14 changes: 14 additions & 0 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
filegroup(
name = "distribution",
srcs = glob(
[
"check_glob/**",
"optional_attributes/**",
],
exclude = [
"**/.gitignore",
"**/MODULE.bazel.lock",
],
),
visibility = ["//:__pkg__"],
)

0 comments on commit b4e2fc8

Please sign in to comment.