Skip to content

Commit

Permalink
Merge pull request #2658 from henry-hsieh/master
Browse files Browse the repository at this point in the history
build: use docker to build linux-x64 glibc
  • Loading branch information
sumneko authored May 11, 2024
2 parents df02432 + ba7041d commit 6347eea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6347eea

Please sign in to comment.