CI: nuke cross compile

This commit is contained in:
Jesse Chan 2021-10-18 20:03:14 -07:00
parent 0e15193813
commit 08907d09d5
6 changed files with 5 additions and 178 deletions

View File

@ -11,14 +11,6 @@ jobs:
fail-fast: false
matrix:
target-node: [10, 12, 14, 16]
target-arch: [x64, arm64]
include:
- target-arch: x64
target-triple: x86_64-linux-musl
host-arch: x86_64
- target-arch: arm64
target-triple: aarch64-linux-musl
host-arch: x86_64
steps:
- uses: actions/checkout@v2
@ -30,14 +22,10 @@ jobs:
uses: docker/build-push-action@v2
with:
build-args: |
HOST_ARCH=${{ matrix.host-arch }}
TARGET_TRIPLE=${{ matrix.target-triple }}
PKG_FETCH_OPTION_a=${{ matrix.target-arch }}
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
PKG_FETCH_OPTION_p=alpine
context: .
file: ./Dockerfile.alpine
platforms: linux/amd64
outputs: type=tar,dest=../out.tar
- name: Extract binaries from Docker image
@ -52,5 +40,5 @@ jobs:
- uses: actions/upload-artifact@v2
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-alpine-${{ matrix.target-arch }}
name: node${{ matrix.target-node }}-alpine-x64
path: root/pkg-fetch/dist/*

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
jobs:
linux-x64:
linux:
runs-on: ubuntu-20.04
strategy:
@ -25,7 +25,6 @@ jobs:
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
context: .
file: ./Dockerfile.linux
platforms: linux/amd64
outputs: type=tar,dest=../out.tar
- name: Extract binaries from Docker image
@ -42,44 +41,3 @@ jobs:
with:
name: node${{ matrix.target-node }}-linux-x64
path: root/pkg-fetch/dist/*
linux-arm64:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target-node: [10, 12, 14, 16]
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
build-args: |
TARGET_TOOLCHAIN_ARCH=aarch64
PKG_FETCH_OPTION_a=arm64
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
context: .
file: ./Dockerfile.linuxcross
platforms: linux/amd64
outputs: type=tar,dest=../out.tar
- name: Extract binaries from Docker image
run: |
tar xvf ../out.tar root/pkg-fetch/dist
- name: Check if binary is compiled
id: check_file
run: |
(test -f root/pkg-fetch/dist/*.sha256sum && echo ::set-output name=EXISTS::true) || echo ::set-output name=EXISTS::false
- uses: actions/upload-artifact@v2
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-linux-arm64
path: root/pkg-fetch/dist/*

View File

@ -11,17 +11,6 @@ jobs:
fail-fast: false
matrix:
target-node: [10, 12, 14, 16]
target-arch: [x64, arm64, armv7]
include:
- target-arch: x64
target-triple: x86_64-linux-musl
host-arch: x86_64
- target-arch: arm64
target-triple: aarch64-linux-musl
host-arch: x86_64
- target-arch: armv7
target-triple: armv7l-linux-musleabihf
host-arch: i686
steps:
- uses: actions/checkout@v2
@ -33,14 +22,10 @@ jobs:
uses: docker/build-push-action@v2
with:
build-args: |
HOST_ARCH=${{ matrix.host-arch }}
TARGET_TRIPLE=${{ matrix.target-triple }}
PKG_FETCH_OPTION_a=${{ matrix.target-arch }}
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
PKG_FETCH_OPTION_p=linuxstatic
context: .
file: ./Dockerfile.alpine
platforms: linux/amd64
outputs: type=tar,dest=../out.tar
- name: Extract binaries from Docker image
@ -55,5 +40,5 @@ jobs:
- uses: actions/upload-artifact@v2
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-linuxstatic-${{ matrix.target-arch }}
name: node${{ matrix.target-node }}-linuxstatic-x64
path: root/pkg-fetch/dist/*

View File

@ -1,9 +1,5 @@
ARG HOST_ARCH=x86_64
ARG TARGET_TRIPLE=aarch64-linux-musl
FROM alpine
FROM muslcc/$HOST_ARCH:$TARGET_TRIPLE
ARG PKG_FETCH_OPTION_a
ARG PKG_FETCH_OPTION_n
ARG PKG_FETCH_OPTION_p
@ -15,25 +11,10 @@ RUN apk add --no-cache build-base git linux-headers npm python2 python3 yarn
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/8626
ENV CFLAGS=-U_FORTIFY_SOURCE
ENV CFLAGS_host=-U_FORTIFY_SOURCE
ENV CXXFLAGS=-U_FORTIFY_SOURCE
ENV CXXFLAGS_host=-U_FORTIFY_SOURCE
ENV CC=/bin/gcc
ENV CXX=/bin/g++
ENV AR=/bin/ar
ENV NM=/bin/nm
ENV READELF=/bin/readelf
ENV STRIP=/bin/strip
ENV CC_host=/usr/bin/gcc
ENV CXX_host=/usr/bin/g++
ENV AR_host=/usr/bin/ar
ENV NM_host=/usr/bin/nm
ENV READELF_host=/usr/bin/readelf
COPY . ./
RUN yarn install
RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --platform $PKG_FETCH_OPTION_p --output dist
RUN yarn start --node-range $PKG_FETCH_OPTION_n --platform $PKG_FETCH_OPTION_p --output dist

View File

@ -1,42 +0,0 @@
FROM ubuntu:bionic
USER root:root
WORKDIR /root/pkg-fetch/
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y curl software-properties-common
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y binutils g++-8 git make patch python python3 python3-distutils
ARG TARGET_TOOLCHAIN_ARCH
RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \
apt-get install -y binutils-${TARGET_TOOLCHAIN_ARCH}-linux-gnu g++-8-${TARGET_TOOLCHAIN_ARCH}-linux-gnu
ENV CC=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-gcc-8
ENV CXX=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-g++-8
ENV AR=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ar
ENV NM=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-nm
ENV RANLIB=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-ranlib
ENV READELF=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-readelf
ENV STRIP=${TARGET_TOOLCHAIN_ARCH}-linux-gnu-strip
ENV CC_host=gcc-8
ENV CXX_host=g++-8
ENV AR_host=ar
ENV NM_host=nm
ENV RANLIB_host=ranlib
ENV READELF_host=readelf
RUN npm install -g yarn
COPY . ./
RUN yarn install
ARG PKG_FETCH_OPTION_a
ARG PKG_FETCH_OPTION_n
RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist

View File

@ -1,43 +0,0 @@
FROM ubuntu:bionic
USER root:root
WORKDIR /root/pkg-fetch/
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y curl software-properties-common
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y binutils g++ git make patch python python3 python3-distutils
RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list
RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update
RUN apt-get install -y clang lld llvm
ARG TARGET_TOOLCHAIN_ARCH
RUN [ `uname -m` = ${TARGET_TOOLCHAIN_ARCH} ] || \
apt-get install -y g++-${TARGET_TOOLCHAIN_ARCH}-linux-gnu
ENV CC="clang --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld"
ENV CXX="clang++ --target=${TARGET_TOOLCHAIN_ARCH}-unknown-linux-gnu -fuse-ld=lld"
ENV AR=llvm-ar
ENV NM=llvm-nm
ENV RANLIB=llvm-ranlib
ENV READELF=llvm-readelf
ENV STRIP=llvm-strip
ENV CC_host=clang
ENV CXX_host=clang++
RUN npm install -g yarn
COPY . ./
RUN yarn install
ARG PKG_FETCH_OPTION_a
ARG PKG_FETCH_OPTION_n
RUN yarn start --arch $PKG_FETCH_OPTION_a --node-range $PKG_FETCH_OPTION_n --output dist