Skip to content

Commit

Permalink
Build release plugins as universal binaries
Browse files Browse the repository at this point in the history
Motivation:

We upload protoc plugins for each release. As it stands, the
architecture these plugins are built for is that of the machine building
them. We should upload universal binaries instead.

Modifications:

- Modify the bundling script to build universal binaries

Result:

Better platform support for the uploaded macOS plugins.
  • Loading branch information
glbrntt committed Jun 15, 2022
1 parent 703d351 commit 3f30b1c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions scripts/bundle-plugins-for-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,19 @@ fi
version=$1
zipfile="protoc-grpc-swift-plugins-${version}.zip"

# Where are we?
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# The root of the repo is just above us.
root="${here}/.."

# Make a staging area.
stage=$(mktemp -d)
stage_bin="${stage}/bin"
mkdir -p "${stage_bin}"

# Make the plugins.
make -C "${root}" plugins
swift build -c release --arch arm64 --arch x86_64 --product protoc-gen-grpc-swift
swift build -c release --arch arm64 --arch x86_64 --product protoc-gen-swift
binpath=$(swift build -c release --arch arm64 --arch x86_64 --show-bin-path)

# Copy them to the stage.
cp "${root}/protoc-gen-grpc-swift" "${stage_bin}"
cp "${root}/protoc-gen-swift" "${stage_bin}"
cp "${binpath}/protoc-gen-grpc-swift" "${stage_bin}"
cp "${binpath}/protoc-gen-swift" "${stage_bin}"

# Copy the LICENSE to the stage.
cp "${root}/LICENSE" "${stage}"
Expand Down

0 comments on commit 3f30b1c

Please sign in to comment.