From d851be31c5100a4958932590d4a97965704ee261 Mon Sep 17 00:00:00 2001 From: Igor Nazarenko Date: Thu, 10 Oct 2024 16:00:13 -0700 Subject: [PATCH] Minor cleanups and a Github workflow to archive a release. --- .github/workflows/bzlmod-archive.yaml | 19 +++++++++++++++++++ .github/workflows/ci.yaml | 2 +- MODULE.bazel | 2 +- protobuf-matchers/protocol-buffer-matchers.h | 10 ++++++---- 4 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/bzlmod-archive.yaml diff --git a/.github/workflows/bzlmod-archive.yaml b/.github/workflows/bzlmod-archive.yaml new file mode 100644 index 0000000..0132b91 --- /dev/null +++ b/.github/workflows/bzlmod-archive.yaml @@ -0,0 +1,19 @@ +name: Bzlmod Archive + +on: + release: + types: [published] + +jobs: + # A release archive is required for bzlmod + # See: https://blog.bazel.build/2023/02/15/github-archive-checksum.html + upload-archive: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - run: git archive -o "${{ format('{0}-{1}.tar.gz', github.event.repository.name, github.event.release.tag_name) }}" HEAD + - run: gh release upload ${{ github.event.release.tag_name }} *.tar.gz + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c634680..7706b4f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,6 +6,6 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run the tests run: bazel test -j 4 //... diff --git a/MODULE.bazel b/MODULE.bazel index 1f7d732..a16125a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -14,7 +14,7 @@ # limitations under the License. # -module(name = "protobuf-matchers") +module(name = "protobuf-matchers", version = "0.1.0") bazel_dep(name = "protobuf", version = "27.3", repo_name = "com_google_protobuf") bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest") bazel_dep(name = "rules_cc", version = "0.0.9") diff --git a/protobuf-matchers/protocol-buffer-matchers.h b/protobuf-matchers/protocol-buffer-matchers.h index cee85b8..7bca71e 100644 --- a/protobuf-matchers/protocol-buffer-matchers.h +++ b/protobuf-matchers/protocol-buffer-matchers.h @@ -201,9 +201,11 @@ #include #include #include +#include #include #include #include +#include #include #include "gmock/gmock-matchers.h" @@ -1185,16 +1187,16 @@ inline InnerProtoMatcher WithDifferencerConfig( return inner_proto_matcher; } -// Aliases in this namespace are provided for historical reasons. Prefer directly -// referring to the definitions in ::protobuf_matchers. +// Aliases in this namespace are provided for historical reasons. Prefer +// directly referring to the definitions in ::protobuf_matchers. namespace proto { using ::protobuf_matchers::Approximately; -using ::protobuf_matchers::TreatingNaNsAsEqual; -using ::protobuf_matchers::IgnoringFields; using ::protobuf_matchers::IgnoringFieldPaths; +using ::protobuf_matchers::IgnoringFields; using ::protobuf_matchers::IgnoringRepeatedFieldOrdering; using ::protobuf_matchers::Partially; +using ::protobuf_matchers::TreatingNaNsAsEqual; using ::protobuf_matchers::WhenDeserialized; using ::protobuf_matchers::WhenDeserializedAs; using ::protobuf_matchers::WithDifferencerConfig;