Skip to content

Commit

Permalink
bazel: Add aptly
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Aug 14, 2024
1 parent 24ff773 commit 4edfac9
Show file tree
Hide file tree
Showing 5 changed files with 502 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/aptly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: |
echo "CI running"
bazel run @com_github_aptly_dev_aptly//:aptly version
34 changes: 34 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

# gazelle:prefix github.com/aptly-dev/aptly
gazelle(name = "gazelle")

genrule(
name = "go.mod",
srcs = ["@com_github_aptly_dev_aptly//:go.mod"],
outs = ["go.mod.txt"],
cmd = "cat $(location @com_github_aptly_dev_aptly//:go.mod) > $@",
)

gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=$(location :go.mod)",
"-to_macro=deps-go.bzl%go_dependencies",
"-prune",
],
command = "update-repos",
data = [":go.mod"],
)

go_library(
name = "aptly_lib",
srcs = ["@com_github_aptly_dev_aptly//:main.go"],
importpath = "github.com/aptly-dev/aptly",
visibility = ["//visibility:private"],
deps = [
"@com_github_aptly_dev_aptly//aptly",
"@com_github_aptly_dev_aptly//cmd",
],
)
51 changes: 51 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
workspace(name = "aptly")

load("//:deps.bzl", "dependencies")

dependencies()

load("//:deps-go.bzl", "aptly_dependencies", "go_dependencies")

go_dependencies()


load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")

py_repositories()

python_register_toolchains(
name = "python_3_11",
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.11",
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")

rules_proto_dependencies()

load("@rules_proto//proto:setup.bzl", "rules_proto_setup")

rules_proto_setup()

load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains")

rules_proto_toolchains()

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.22.4")

gazelle_dependencies(go_repository_default_config = "//:WORKSPACE")

# gazelle:repo bazel_gazelle
# gazelle:repository_macro deps-go.bzl%go_dependencies
aptly_dependencies()
go_dependencies()
Loading

0 comments on commit 4edfac9

Please sign in to comment.