Skip to content

Build dev Linux binary #2

Build dev Linux binary

Build dev Linux binary #2

name: Build dev Linux binary
on:
workflow_dispatch:
jobs:
build-dev-linux:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-linux-musl
arch: x64
xz_bcj: --x86
name: amd64
- target: aarch64-linux-musl
arch: arm64
xz_bcj:
name: aarch64
# disabled due to compiler crashing
#- target: armv7l-linux-musleabihf
# arch: arm
# xz_bcj: --arm
# name: armhf
name: Build ${{ matrix.name }} dev Linux binary
runs-on: ubuntu-latest
env:
BUILD_ARCH: ${{ matrix.arch }}
BUILD_LOGLEVEL: verbose
BUILD_CONFIGURE: '--with-arm-float-abi=hard --with-arm-fpu=vfpv3-d16'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9' # workaround "cannot import name 'Mapping' from 'collections'" error
- uses: Lesmiscore/musl-cross-compilers@jockie
id: musl
with:
target: ${{ matrix.target }}
- name: Install i386 dev
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libstdc++-$(c++ -dumpversion)-dev:i386 libc6-dev:i386 g++-multilib
if: ${{ matrix.arch == 'arm' }}
- run: npm install --production
- run: (cd nexe && npm install --production)
- run: (cd nexe && node build)
env:
CC: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-cc
CXX: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-c++
CC_host: cc
CXX_host: c++
- run: ${{ steps.musl.outputs.path }}/${{ matrix.target }}-strip nexe/nyuu
- run: tar --group=nobody --owner=nobody -cf - -C nexe nyuu ../config-sample.json | xz -9e ${{ matrix.xz_bcj }} --lzma2 > nyuu.txz
- uses: actions/upload-artifact@v3
with:
path: ./nyuu.txz
name: nyuu-${{ github.ref_name }}-linux-${{ matrix.name }}.7z
retention-days: 5