-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actions: build node addon for aarch linux via zig
- Loading branch information
Showing
3 changed files
with
15 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,41 +23,30 @@ jobs: | |
with: | ||
node-version: lts/* | ||
cache: npm | ||
- uses: goto-bus-stop/setup-zig@v2 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Clean old binaries | ||
run: npm run clean -w tdl | ||
- name: Prebuildify in docker | ||
- name: Prebuildify (Linux via zig) | ||
if: runner.os == 'Linux' | ||
run: | | ||
# docker run -u root -v $(pwd):/app ghcr.io/prebuild/centos7-devtoolset7:2 \ | ||
# npm run make-prebuild -w tdl -- --tag-libc | ||
cat > prebuilt-node-addon.sh <<EOF | ||
set -ex | ||
yum update -y | ||
yum install -y centos-release-scl | ||
yum install -y devtoolset-9 make python3 | ||
yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y | ||
yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1 | ||
source /opt/rh/devtoolset-9/enable | ||
gcc --version | ||
ldd --version | ||
cd /app | ||
npm run make-prebuild -w tdl -- --tag-libc | ||
EOF | ||
docker run -v $(pwd):/app centos:7 \ | ||
bash /app/prebuilt-node-addon.sh | ||
CC="zig cc -target x86_64-linux-gnu.2.17" CXX="zig c++ -target x86_64-linux-gnu.2.17" \ | ||
npm run make-prebuild -w tdl -- --arch x64 --tag-libc | ||
CC="zig cc -target aarch64-linux-gnu.2.17" CXX="zig c++ -target aarch64-linux-gnu.2.17" \ | ||
npm run make-prebuild -w tdl -- --arch arm64 --armv 8 --tag-armv --tag-libc | ||
ldd packages/tdl/prebuilds/*/*.node | ||
du -hs packages/tdl/prebuilds/*/*.node | ||
du -hsc packages/tdl/prebuilds/*/*.node | ||
- name: Prebuildify | ||
if: runner.os != 'Linux' | ||
run: npm run make-prebuild -w tdl | ||
run: npm run make-prebuild -w tdl -- --arch x64 | ||
- name: "Prebuildify: Crosscompile to arm64 Apple Silicon" | ||
if: runner.os == 'macOS' | ||
run: npm run make-prebuild -w tdl -- --arch arm64 | ||
- name: Install prebuilt-tdlib for TDLib v1.8.0 | ||
run: npm i -D [email protected] | ||
- name: Run tests | ||
run: | | ||
npm run make-prebuild -w tdl -- --arch arm64 | ||
file packages/tdl/prebuilds/*/*.node | ||
du -hsc packages/tdl/prebuilds/*/*.node | ||
- name: Run tests (unit tests + integration tests) | ||
run: npm run test:all | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters