From 7e45aea6fae1afda4f42c80e4a713ca3ec811eb8 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 27 Dec 2023 19:56:07 +0200 Subject: [PATCH] Use a Docker image with preinstalled packages --- .github/workflows/build.yml | 22 ++++++++++------------ Dockerfile | 10 ++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73a59b0..3598a09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,11 @@ env: jobs: build-linux: runs-on: node-16 + container: + image: gitea.antonlyap.pp.ua/antonlyap/bliss-rs/node-rust:latest + credentials: + username: antonlyap + password: ${{ secrets.ACCESS_TOKEN }} strategy: matrix: target: @@ -21,22 +26,15 @@ jobs: - aarch64-unknown-linux-musl steps: - - name: Packages - run: apt-get update && apt-get install -yqq build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev libclang-dev ffmpeg - + - name: Switch toolchain + run: rustup default stable-${{ matrix.target }} + - uses: actions/checkout@v4 - - name: Install Rust ${{ matrix.target }} - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: false - - run: npm install - - run: npm run build + - run: npm run build -- --release - uses: actions/upload-artifact@v3 with: - name: binary + name: binary-${{ matrix.target }} path: index.node diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7c2dc5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:20-bookworm + +RUN apt-get update +RUN apt-get install -yqq wget build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev libclang-dev ffmpeg + +WORKDIR /opt/rust +RUN wget https://sh.rustup.rs -O rustup-init.sh +RUN chmod +x rustup-init.sh +RUN ./rustup-init.sh -y -t x86_64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-gnu aarch64-unknown-linux-musl +