|
25 | 25 | arch: arm64 |
26 | 26 | name: mac |
27 | 27 | # TODO It seems arm64 is not available yet (2024-11) |
28 | | - - os: ubuntu-latest |
| 28 | + - os: ARM64 |
29 | 29 | arch: arm64 |
30 | 30 | name: linux |
31 | 31 | # TODO Need some tweaks to run sbt on Windows |
|
40 | 40 | - uses: actions/checkout@v4 |
41 | 41 | with: |
42 | 42 | path: local |
43 | | - |
44 | | - - name: Local Patches for Library -x |
45 | | - if: false |
46 | | - run: | |
47 | | - cp local/_patches/WvcMain.scala wvc/src/main/scala/wvlet/lang/native/WvcMain.scala |
48 | | - cp local/_patches/WvcLib.scala wvc/src/main/scala/wvlet/lang/native/WvcLib.scala |
49 | | - cp local/_patches/Makefile wvc-lib/Makefile |
50 | | - cp local/_patches/build.sbt build.sbt |
51 | 43 |
|
52 | 44 | - uses: actions/setup-java@v4 |
53 | 45 | with: |
|
61 | 53 | echo "SCALA_VERSION=$SCALA_VERSION" >> $GITHUB_ENV |
62 | 54 |
|
63 | 55 | - name: Build native libraries for ${{ matrix.name }}-${{ matrix.arch }} |
64 | | - if: ${{ !(matrix.name == 'linux' && matrix.arch == 'arm64') }} |
65 | 56 | run: | |
66 | 57 | ./sbt 'wvcLib/nativeLink' |
67 | 58 | ./sbt 'wvcLibStatic/nativeLink' |
|
71 | 62 | cp $FILEPATH ./out/ |
72 | 63 | cd ./out && for f in *.*; do mv -- "$f" "${{ matrix.name }}-${{ matrix.arch }}_$f"; done |
73 | 64 | ls -alFh |
74 | | -
|
75 | | - - name: Docker Setup QEMU |
76 | | - if: ${{ matrix.name == 'linux' && matrix.arch == 'arm64' }} |
77 | | - uses: docker/setup-qemu-action@v2 |
78 | | - with: |
79 | | - platforms: arm64 |
80 | | - |
81 | | - - name: Re-Build native libraries in ARM64-emulated environment |
82 | | - if: ${{ matrix.name == 'linux' && matrix.arch == 'arm64' }} |
83 | | - run: | |
84 | | - docker run --rm -v $(pwd):/${{ github.workspace }} -w ${{ github.workspace }} --platform linux/${{ matrix.arch }} arm64v8/ubuntu:oracular /bin/bash -c " |
85 | | - apt-get update && apt-get install ca-certificates apt-transport-https curl gnupg build-essential -yqq && |
86 | | - echo 'deb https://repo.scala-sbt.org/scalasbt/debian all main' | tee /etc/apt/sources.list.d/sbt.list && |
87 | | - echo 'deb https://repo.scala-sbt.org/scalasbt/debian /' | tee /etc/apt/sources.list.d/sbt_old.list && |
88 | | - curl -sL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823' | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import && |
89 | | - chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg && |
90 | | - apt-get update && |
91 | | - apt-get install -y openjdk-23-jdk-headless sbt clang libstdc++-12-dev libgc-dev zlib1g-dev libssl-dev && |
92 | | - ./sbt 'wvcLib/nativeLink' && |
93 | | - ./sbt 'wvcLibStatic/nativeLink' && |
94 | | - FILEPATH=$(find . -name 'libwvlet.*') && echo $FILEPATH && |
95 | | - mkdir -p out && |
96 | | - cp $FILEPATH ./out/ && |
97 | | - cd ./out && for f in *.*; do mv -- \"\$f\" \"linux-arm64_\$f\"; done && |
98 | | - ls -alFh" |
99 | 65 | |
100 | 66 | - name: Upload native libraries for ${{ matrix.name }}-${{ matrix.arch }} |
101 | 67 | uses: actions/upload-artifact@v4 |
|
0 commit comments