Skip to content

Commit

Permalink
Manually merge TryGhost#1742
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrsatrio committed Dec 27, 2024
1 parent bc5c11a commit f3bab00
Showing 1 changed file with 76 additions and 55 deletions.
131 changes: 76 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
node:
- 20
include:
- os: ubuntu-20.04
node: 20
host: x64
target: arm64
- os: windows-latest
node: 20
host: x64
Expand Down Expand Up @@ -80,15 +84,33 @@ jobs:
echo "CFLAGS=${CFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
- name: Setup cross compilation for Linux ARM64
if: contains(matrix.os, 'ubuntu') && matrix.target == 'arm64'
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
echo "AS=aarch64-linux-gnu-as" >> $GITHUB_ENV
echo "STRIP=aarch64-linux-gnu-strip" >> $GITHUB_ENV
echo "AR=aarch64-linux-gnu-ar" >> $GITHUB_ENV
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CPP=aarch64-linux-gnu-cpp" >> $GITHUB_ENV
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
echo "LD=aarch64-linux-gnu-ld" >> $GITHUB_ENV
echo "FC=aarch64-linux-gnu-gfortran" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
- name: Build binaries
run: yarn prebuild -a ${{ env.TARGET }}

- name: Print binary info
if: contains(matrix.os, 'ubuntu')
run: |
ldd build/**/node_sqlite3.node
if [ "${{ matrix.target }}" = "arm64" ]; then
PREFIX=aarch64-linux-gnu-
fi
${PREFIX}readelf -d build/**/node_sqlite3.node | grep "Shared library"
echo "---"
nm build/**/node_sqlite3.node | grep "GLIBC_" | c++filt || true
${PREFIX}nm build/**/node_sqlite3.node | grep "GLIBC_" | ${PREFIX}c++filt || true
echo "---"
file build/**/node_sqlite3.node
Expand All @@ -108,56 +130,55 @@ jobs:
run: yarn upload --upload-all ${{ github.token }}
if: matrix.node == 20 && startsWith(github.ref, 'refs/tags/')

# build-qemu:
# runs-on: ubuntu-latest
# if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
# strategy:
# fail-fast: false
# matrix:
# node:
# - 20
# target:
# - linux/arm64
# variant:
# - bullseye
# - alpine3.15
# include:
# # musl x64 builds
# - target: linux/amd64
# variant: alpine3.15
# node: 20
# name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
# steps:
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Build binaries and test
# run: |
# docker buildx build \
# --file ./tools/BinaryBuilder.Dockerfile \
# --load \
# --tag sqlite-builder \
# --platform ${{ matrix.target }} \
# --no-cache \
# --build-arg VARIANT=${{ matrix.variant }} \
# --build-arg NODE_VERSION=${{ matrix.node }} \
# .
# CONTAINER_ID=$(docker create -it sqlite-builder)
# docker cp $CONTAINER_ID:/usr/src/build/prebuilds/ ./prebuilds
#
# - name: Upload binaries to commit artifacts
# uses: actions/upload-artifact@v4
# if: matrix.node == 20
# with:
# name: prebuilt-binaries
# path: prebuilds/*
# retention-days: 7
#
# - name: Upload binaries to GitHub Release
# run: yarn install --ignore-scripts && yarn upload --upload-all ${{ github.token }}
# if: matrix.node == 20 && startsWith(github.ref, 'refs/tags/')
build-qemu:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
matrix:
node:
- 20
target:
- linux/arm64
variant:
- alpine3.20
include:
# musl x64 builds
- target: linux/amd64
variant: alpine3.20
node: 20
name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build binaries and test
run: |
docker buildx build \
--file ./tools/BinaryBuilder.Dockerfile \
--load \
--tag sqlite-builder \
--platform ${{ matrix.target }} \
--no-cache \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg NODE_VERSION=${{ matrix.node }} \
.
CONTAINER_ID=$(docker create -it sqlite-builder)
docker cp $CONTAINER_ID:/usr/src/build/prebuilds/ ./prebuilds
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v4
if: matrix.node == 20
with:
name: prebuilt-binaries
path: prebuilds/*
retention-days: 7

- name: Upload binaries to GitHub Release
run: yarn install --ignore-scripts && yarn upload --upload-all ${{ github.token }}
if: matrix.node == 20 && startsWith(github.ref, 'refs/tags/')

0 comments on commit f3bab00

Please sign in to comment.