Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
build --copt=-Wno-error=deprecated-declarations --host_copt=-Wno-error=deprecated-declarations
# Common build settings for unix-like systems
build --copt=-Wno-error=deprecated-declarations
build --host_copt=-Wno-error=deprecated-declarations

# Required until this is the default; expected in Bazel 7
common --enable_bzlmod

# Load any settings specific to the current user.
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
# This needs to be last statement in this
# config, as the user configuration should be able to overwrite flags from this file.
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
# rather than user.bazelrc as suggested in the Bazel docs)
# Per-user settings (gitignored). Keep last so local flags can override.
# Docs: https://bazel.build/configure/best-practices#bazelrc
try-import %workspace%/.bazelrc.user

13 changes: 13 additions & 0 deletions .bazelrc.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is a Windows-specific bazelrc file for use in GitHub Actions.
# It contains settings from the main .bazelrc file that are relevant for Windows builds.

# Windows specific settings
build --copt=-DABSL_HAVE_WORKING_GCC_WNO_DEPRECATED_DECLARATIONS=0
build --host_copt=-DABSL_HAVE_WORKING_GCC_WNO_DEPRECATED_DECLARATIONS=0

# Required until this is the default; expected in Bazel 7
common --enable_bzlmod

# Per-user settings (gitignored). Keep last so local flags can override.
# Docs: https://bazel.build/configure/best-practices#bazelrc
try-import %workspace%/.bazelrc.user
42 changes: 0 additions & 42 deletions .github/workflows/make-plugin-arm.yml

This file was deleted.

95 changes: 80 additions & 15 deletions .github/workflows/make-plugin-linux.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,97 @@
name: Make Linux Plugin

on:
push:
paths:
- .github/workflows/make-plugin-linux.yml
pull_request:
paths:
- .github/workflows/make-plugin-linux.yml
workflow_dispatch:
inputs:
version_number:
description: 'Version number'
required: true
default: '1.x.x'
default: '2.x.x'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Build plugin docker image
run: docker-compose build prereqs protoc-plugin
- name: Copy binary from Docker image
- uses: actions/checkout@v4
- name: Compute VERSION_NUMBER
run: |
docker cp $(docker create grpcweb/protoc-plugin):/github/grpc-web/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
./protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64
- name: gen sha256
INPUT_VERSION="${{ github.event.inputs.version_number }}"
if [ -n "$INPUT_VERSION" ]; then
VERSION="$INPUT_VERSION"
else
VERSION="$GITHUB_REF_NAME"
fi
VERSION="${VERSION//\//-}"
echo "VERSION_NUMBER=$VERSION" >> "$GITHUB_ENV"
echo "Computed VERSION_NUMBER=$VERSION"
- name: Compute ARCH suffix and artifact name
id: meta
run: |
openssl dgst -sha256 -r -out protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64.sha256 \
protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64
- name: verify sha256
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64.sha256
ARCH=$(uname -m)
case "$ARCH" in
aarch64|arm64)
ARCH_SUFFIX="aarch64"
;;
x86_64|amd64)
ARCH_SUFFIX="x86_64"
;;
*)
echo "Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
ARTIFACT="protoc-gen-grpc-web-${VERSION_NUMBER}-linux-${ARCH_SUFFIX}"
echo "ARTIFACT=$ARTIFACT" >> "$GITHUB_ENV"
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
echo "Will produce artifact: $ARTIFACT"
- name: Install Bazelisk (Bazel)
run: |
sudo apt-get update
sudo apt-get install -y unzip zip
ARCH=$(uname -m)
case "$ARCH" in
aarch64|arm64)
BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64"
;;
x86_64|amd64)
BAZELISK_URL="https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64"
;;
*)
echo "Unsupported architecture for Bazelisk: $ARCH" >&2
exit 1
;;
esac
echo "Downloading Bazelisk from $BAZELISK_URL"
sudo curl -L -o /usr/local/bin/bazelisk "$BAZELISK_URL"
sudo chmod +x /usr/local/bin/bazelisk
# Also provide `bazel` symlink for tools that expect it
sudo ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel
bazelisk version
- name: Build protoc-gen-grpc-web with Bazel
run: |
bazelisk build //javascript/net/grpc/web/generator:protoc-gen-grpc-web
- name: Move artifact
run: |
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
./${ARTIFACT}
- name: Generate sha256
run: |
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
${ARTIFACT}
- name: Verify sha256
run: sha256sum -c ${ARTIFACT}.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: plugin
name: ${{ steps.meta.outputs.artifact }}
path: protoc-gen-grpc-web*
106 changes: 69 additions & 37 deletions .github/workflows/make-plugin-mac-os.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,80 @@
name: Make MacOS Plugin
name: Make macOS Plugin

on:
push:
paths:
- .github/workflows/make-plugin-mac-os.yml
pull_request:
paths:
- .github/workflows/make-plugin-mac-os.yml
workflow_dispatch:
inputs:
version_number:
description: 'Version number'
required: true
default: '1.x.x'
default: '2.x.x'

jobs:
build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install build utils
run: brew install coreutils automake
- name: Checkout protobuf code
run: |
./scripts/init_submodules.sh
# Protobuf build instructions from:
# https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
- name: Build protobuf (configure & make)
run: |
cd ./third_party/protobuf
./autogen.sh
./configure
make -j$(nproc)
make install
- name: Remove dynamite dependencies (similar to `-static` on linux)
run: rm /usr/local/lib/libproto*.dylib
- name: make
run: make clean && make plugin
- name: move
run: |
mv javascript/net/grpc/web/generator/protoc-gen-grpc-web \
./protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64
- name: gen sha256
run: |
openssl dgst -sha256 -r -out protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64.sha256 \
protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64
- name: verify sha256
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: plugin
path: protoc-gen-grpc-web*
- uses: actions/checkout@v4
- name: Compute VERSION_NUMBER
run: |
INPUT_VERSION="${{ github.event.inputs.version_number }}"
if [ -n "$INPUT_VERSION" ]; then
VERSION="$INPUT_VERSION"
else
VERSION="$GITHUB_REF_NAME"
fi
# Minimal sanitization: replace slashes with dashes to keep filenames valid
VERSION="${VERSION//\//-}"
echo "VERSION_NUMBER=$VERSION" >> "$GITHUB_ENV"
echo "Computed VERSION_NUMBER=$VERSION"
- name: Compute ARCH suffix and artifact name
id: meta
run: |
ARCH=$(uname -m)
case "$ARCH" in
arm64)
ARCH_SUFFIX="aarch64"
;;
x86_64)
ARCH_SUFFIX="x86_64"
;;
*)
echo "Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
ARTIFACT="protoc-gen-grpc-web-${VERSION_NUMBER}-darwin-${ARCH_SUFFIX}"
echo "ARTIFACT=$ARTIFACT" >> "$GITHUB_ENV"
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
echo "Will produce artifact: $ARTIFACT"
- name: Install Bazelisk (Bazel)
run: |
brew update
brew install bazelisk
bazelisk version
- name: Build protoc-gen-grpc-web with Bazel
run: |
bazelisk build //javascript/net/grpc/web/generator:protoc-gen-grpc-web
- name: Move artifact
run: |
mv bazel-bin/javascript/net/grpc/web/generator/protoc-gen-grpc-web \
./${ARTIFACT}
- name: Generate sha256
run: |
openssl dgst -sha256 -r -out ${ARTIFACT}.sha256 \
${ARTIFACT}
- name: Verify sha256
run: shasum -a 256 -c ${ARTIFACT}.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.meta.outputs.artifact }}
path: protoc-gen-grpc-web*
Loading
Loading