Skip to content

Commit 58db303

Browse files
google-labs-jules[bot]dibenede
authored andcommitted
feat: Add Linux runners for all supported architectures
This change expands the existing CI/CD pipeline to include Linux builds for all supported, non-x86-32 architectures. The following changes were made: - Added `ubuntu-20.04` runners for `x86_64`, `aarch64`, `ppc64le`, and `s390x`. - Integrated the `uraimo/run-on-arch-action` to facilitate builds on emulated, non-x86 architectures. - Updated the build matrix and steps in `.github/workflows/build.yml` to support the new runners. - Dropped support for the `x86-32` architecture as requested.
1 parent cbeded2 commit 58db303

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@ jobs:
5656
strategy:
5757
fail-fast: false
5858
matrix:
59-
# for now I'm disabling linux building as we don't have the tooling to support it
60-
# os: [ ubuntu-latest ]
61-
# cpu:
62-
# - k8 # this build 'linux-x86_64', is currently working but not useful without the other architectures
63-
# would need some kind of CROSSTOOL chain to build the other architectures
64-
# or we'd have to use the https://github.com/uraimo/run-on-arch-action (which lacks support for x86_32) to build these
65-
# - x86_32
66-
# - systemz
67-
# - aarch64
68-
# - ppc64
6959
include:
7060
# to ensure backwards compatibility as long as possible, use earliest versions of OSs available on Github Actions
61+
- os: ubuntu-22.04
62+
cpu: x86_64
63+
bazel_target: dist_zip
64+
- os: ubuntu-22.04
65+
cpu: aarch64
66+
bazel_target: dist_zip
67+
arch: aarch64
68+
- os: ubuntu-22.04
69+
cpu: ppc64le
70+
bazel_target: dist_zip
71+
arch: ppc64le
72+
- os: ubuntu-22.04
73+
cpu: s390x
74+
bazel_target: dist_zip
75+
arch: s390x
7176
- os: windows-2022
7277
cpu: x64_windows
7378
bazel_target: dist_zip
@@ -96,13 +101,26 @@ jobs:
96101

97102
- run: mkdir out
98103

99-
# setup-bazelisk fails when running in ACT because the cache is not available so we need to ignore to let the bazel step run
100-
- if: success() || env.ACT && failure()
101-
run: bazel build --cpu=${{ matrix.cpu }} ${{ matrix.bazel_target || 'dist_all' }}
102-
shell: bash
103-
104-
# need to copy to output directory as `bazel-bin` is a symlink and cannot be read by the actions/upload-artifact action
105-
- run: cp bazel-bin/protobuf-javascript-* out/
104+
- name: Build on emulated arch
105+
uses: uraimo/run-on-arch-action@v3
106+
if: matrix.arch
107+
with:
108+
arch: ${{ matrix.arch }}
109+
distro: ubuntu22.04
110+
githubToken: ${{ secrets.GITHUB_TOKEN }}
111+
run: |
112+
# setup-bazelisk fails when running in ACT because the cache is not available so we need to ignore to let the bazel step run
113+
bazel build --cpu=${{ matrix.cpu }} ${{ matrix.bazel_target || 'dist_all' }}
114+
# need to copy to output directory as `bazel-bin` is a symlink and cannot be read by the actions/upload-artifact action
115+
cp bazel-bin/protobuf-javascript-* out/
116+
117+
- name: Build on native arch
118+
if: ${{ !matrix.arch }}
119+
run: |
120+
# setup-bazelisk fails when running in ACT because the cache is not available so we need to ignore to let the bazel step run
121+
bazel build --cpu=${{ matrix.cpu }} ${{ matrix.bazel_target || 'dist_all' }}
122+
# need to copy to output directory as `bazel-bin` is a symlink and cannot be read by the actions/upload-artifact action
123+
cp bazel-bin/protobuf-javascript-* out/
106124
107125
- uses: actions/upload-artifact@v4
108126
with:

0 commit comments

Comments
 (0)