From ba7041dbe8ccca6ecc5cb6a3b0a7179826bc46a8 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 11 May 2024 11:46:43 +0800 Subject: [PATCH] build: use docker to build linux-x64 glibc --- .github/workflows/build.yml | 12 +++++++++--- Dockerfile | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef6e5b17a..bfedcd504 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,17 +51,23 @@ jobs: submodules: recursive - name: Build for others step-1 - if: ${{ matrix.libc != 'musl' }} + if: ${{ matrix.platform != 'linux-x64' }} uses: actboy168/setup-luamake@master - name: Build for others step-2 - if: ${{ matrix.libc != 'musl' }} + if: ${{ matrix.platform != 'linux-x64' }} run: luamake -platform ${{ matrix.platform }} - name: Build for musl - if: ${{ matrix.target == 'linux' && matrix.libc == 'musl' }} + if: ${{ matrix.platform == 'linux-x64' && matrix.libc == 'musl' }} run: ./make.sh + - name: Build for x64 glibc + if: ${{ matrix.platform == 'linux-x64' && matrix.libc != 'musl' }} + run: | + docker build -t ubuntu-18.04 . + docker run --rm -v $(pwd):$(pwd) -w $(pwd) ubuntu-18.04 bash -c './make.sh' + - name: Setting up workflow variables id: vars shell: bash diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ec57d0fee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Dockerfile + +FROM ubuntu:18.04 + +# Install necessary packages +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ + add-apt-repository -y ppa:git-core/ppa && \ + apt-get install -y git gcc-9 g++-9 wget tar gzip rsync ninja-build + +# Use alternative gcc +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100