Skip to content

Commit 3ca2e70

Browse files
authored
Use Zig to build aarch64 binaries (#1249)
1 parent 012b226 commit 3ca2e70

File tree

6 files changed

+264
-6
lines changed

6 files changed

+264
-6
lines changed

.github/workflows/make-plugin-arm.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Make ARM Plugins (Windows/macOS/Linux)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_number:
7+
description: 'Version number'
8+
required: true
9+
default: '1.x.x'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
submodules: 'recursive'
18+
- name: Setup Zig
19+
run: |
20+
mkdir /zig
21+
curl 'https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz' | tar xJ --strip-components=1 --directory=/zig
22+
ln -s /zig/zig /usr/bin/zig
23+
- name: Build plugin
24+
env:
25+
VERSION: ${{ github.event.inputs.version_number }}
26+
run: |
27+
cd javascript/net/grpc/web/generator
28+
zig build -Drelease-fast
29+
- name: gen and verify sha256
30+
run: |
31+
cd javascript/net/grpc/web/generator/zig-out/bin
32+
for exe in $(ls)
33+
do
34+
openssl dgst -sha256 -r -out $exe'.sha256' $exe
35+
sha256sum -c $exe'.sha256'
36+
done
37+
- name: Upload artifacts
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: plugin
41+
path: javascript/net/grpc/web/generator/zig-out/bin/

.github/workflows/make-plugin-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Build plugin docker image
1717
run: docker-compose build prereqs protoc-plugin
1818
- name: Copy binary from Docker image
@@ -26,7 +26,7 @@ jobs:
2626
- name: verify sha256
2727
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-linux-x86_64.sha256
2828
- name: Upload artifacts
29-
uses: actions/upload-artifact@v2
29+
uses: actions/upload-artifact@v3
3030
with:
3131
name: plugin
3232
path: protoc-gen-grpc-web*

.github/workflows/make-plugin-mac-os.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: macos-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Install build utils
1717
run: brew install coreutils automake
1818
- name: Checkout protobuf code
@@ -42,7 +42,7 @@ jobs:
4242
- name: verify sha256
4343
run: sha256sum -c protoc-gen-grpc-web-${{ github.event.inputs.version_number }}-darwin-x86_64.sha256
4444
- name: Upload artifacts
45-
uses: actions/upload-artifact@v2
45+
uses: actions/upload-artifact@v3
4646
with:
4747
name: plugin
4848
path: protoc-gen-grpc-web*

.github/workflows/make-plugin-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: windows-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Print Bazel version
1717
run: |
1818
bazel version
@@ -31,7 +31,7 @@ jobs:
3131
# TODO: Check sha256 (sha256sum not available for now. )
3232
#- name: verify sha256
3333
- name: Upload artifacts
34-
uses: actions/upload-artifact@v2
34+
uses: actions/upload-artifact@v3
3535
with:
3636
name: plugin
3737
path: protoc-gen-grpc-web*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ target
1111
.project
1212
.classpath
1313
.settings
14+
zig-out
15+
zig-cache

0 commit comments

Comments
 (0)