-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Bazel build and add a GitHub action to exercise the build on diff…
…erent platforms (#43) * feat: http_archive * feat: gen_cc * feat: actions * feat: platforms configurations * fix: nitpicks * fix: actions
- Loading branch information
1 parent
d413219
commit 860e791
Showing
5 changed files
with
103 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Binary | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [amd64, arm64] | ||
targetos: [windows, darwin, linux] | ||
name: ${{ matrix.arch }}-${{ matrix.targetos }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
sudo apt install apt-transport-https curl gnupg | ||
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg | ||
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ | ||
sudo echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list | ||
- run: | | ||
bazel build @com_google_protobuf//:protoc | ||
bazel build //firebase_rules_generator:protoc-gen-firebase_rules --platforms=//:${{ matrix.targetos }}-${{ matrix.arch }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: protoc-gen-firebase_rules-${{ matrix.targetos }}-${{ matrix.arch }} | ||
path: bazel-bin/firebase_rules_generator/protoc-gen-firebase_rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
protobuf_commit = "099d99759101c295244c24d8954ec85b8ac65ce3" | ||
|
||
protobuf_sha256 = "c0ab1b088e220c1d56446f34001f0178e590270efdef1c46a77da4b9faa9d7b0" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
def protobuf_rules_gen_repositories(): | ||
if "com_google_protobuf" not in native.existing_rules(): | ||
native.http_archive( | ||
http_archive( | ||
name = "rules_python", | ||
sha256 = "934c9ceb552e84577b0faf1e5a2f0450314985b4d8712b2b70717dc679fdc01b", | ||
url = "https://github.com/bazelbuild/rules_python/releases/download/0.3.0/rules_python-0.3.0.tar.gz", | ||
) | ||
http_archive( | ||
name = "bazel_skylib", | ||
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", | ||
urls = [ | ||
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", | ||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", | ||
], | ||
) | ||
http_archive( | ||
name = "zlib", | ||
build_file = "@com_google_protobuf//:third_party/zlib.BUILD", | ||
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", | ||
strip_prefix = "zlib-1.2.11", | ||
urls = [ | ||
"https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz", | ||
"https://zlib.net/zlib-1.2.11.tar.gz", | ||
], | ||
) | ||
http_archive( | ||
name = "com_google_protobuf", | ||
sha256 = protobuf_sha256, | ||
strip_prefix = "protobuf-" + protobuf_commit, | ||
url = "https://github.com/google/protobuf/archive/" + protobuf_commit + ".tar.gz", | ||
sha256 = "528927e398f4e290001886894dac17c5c6a2e5548f3fb68004cfb01af901b53a", | ||
strip_prefix = "protobuf-3.17.3", | ||
url = "https://github.com/google/protobuf/archive/v3.17.3.zip", | ||
) |