Skip to content

Commit d07041e

Browse files
committed
Build release plugins as universal binaries
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.
1 parent 703d351 commit d07041e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/bundle-plugins-for-release.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ stage_bin="${stage}/bin"
4545
mkdir -p "${stage_bin}"
4646

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

5052
# Copy them to the stage.
51-
cp "${root}/protoc-gen-grpc-swift" "${stage_bin}"
52-
cp "${root}/protoc-gen-swift" "${stage_bin}"
53+
cp "${binpath}/protoc-gen-grpc-swift" "${stage_bin}"
54+
cp "${binpath}/protoc-gen-swift" "${stage_bin}"
5355

5456
# Copy the LICENSE to the stage.
5557
cp "${root}/LICENSE" "${stage}"

0 commit comments

Comments
 (0)