Skip to content

Commit b5277db

Browse files
committed
Build static arm64 Linux binaries
1 parent 6bd7ffb commit b5277db

File tree

1 file changed

+55
-9
lines changed

1 file changed

+55
-9
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ jobs:
2020
# for more info.
2121
# The container already comes with all required tools pre-installed
2222
# (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
23-
static-binaries-linux:
23+
static-binaries-linux-amd64:
2424
runs-on: ubuntu-latest
2525

2626
container:
27-
image: ghcr.io/rescript-lang/rescript-ci-build:v1.0.0
27+
image: ghcr.io/rescript-lang/rescript-ci-build:main
2828

2929
steps:
3030
- name: Checkout
3131
uses: actions/checkout@v3
3232

3333
- name: Build compiler binaries
34-
run: opam exec -- dune build --profile static
34+
run: opam exec -- dune build --display quiet --profile static
3535

3636
- name: Build ninja binary
3737
working-directory: ninja
@@ -42,18 +42,58 @@ jobs:
4242
- name: "Upload artifacts"
4343
uses: actions/upload-artifact@v3
4444
with:
45-
name: static-binaries-linux
45+
name: static-binaries-linux-amd64
46+
path: |
47+
_build/install/default/bin
48+
ninja/ninja
49+
50+
static-binaries-linux-arm64:
51+
runs-on: buildjet-2vcpu-ubuntu-2204-arm
52+
53+
container:
54+
image: ghcr.io/rescript-lang/rescript-ci-build:main
55+
56+
steps:
57+
# See https://github.com/actions/runner/issues/801#issuecomment-1374967227.
58+
- name: Workaround for Github actions runner on Alpine arm64
59+
run: sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
60+
61+
- name: Checkout
62+
uses: actions/checkout@v3
63+
64+
- name: Build compiler binaries
65+
run: opam exec -- dune build --display quiet --profile static
66+
67+
- name: Build ninja binary
68+
working-directory: ninja
69+
env:
70+
LDFLAGS: -static
71+
run: python3 configure.py --bootstrap --verbose
72+
73+
- name: "Upload artifacts"
74+
uses: actions/upload-artifact@v3
75+
with:
76+
name: static-binaries-linux-arm64
4677
path: |
4778
_build/install/default/bin
4879
ninja/ninja
4980
5081
build:
51-
needs: static-binaries-linux
82+
needs:
83+
- static-binaries-linux-amd64
84+
- static-binaries-linux-arm64
5285

5386
strategy:
5487
fail-fast: false
5588
matrix:
56-
os: [macos-latest, ubuntu-latest, windows-latest, macos-arm]
89+
os:
90+
[
91+
macos-latest,
92+
macos-arm,
93+
ubuntu-22.04,
94+
buildjet-2vcpu-ubuntu-2204-arm,
95+
windows-latest,
96+
]
5797
ocaml_compiler: [4.14.0]
5898

5999
runs-on: ${{matrix.os}}
@@ -73,11 +113,17 @@ jobs:
73113
with:
74114
fetch-depth: 2 # to be able to check for changes in subfolder res_syntax later
75115

76-
- name: Download static linux binaries
77-
if: runner.os == 'Linux'
116+
- name: Download static linux binaries (amd64)
117+
if: runner.os == 'Linux' && runner.arch == "X64"
118+
uses: actions/download-artifact@v3
119+
with:
120+
name: static-binaries-linux-amd64
121+
122+
- name: Download static linux binaries (arm64)
123+
if: runner.os == 'Linux' && runner.arch == "ARM64"
78124
uses: actions/download-artifact@v3
79125
with:
80-
name: static-binaries-linux
126+
name: static-binaries-linux-arm64
81127

82128
- name: Make static linux binaries executable
83129
if: runner.os == 'Linux'

0 commit comments

Comments
 (0)