From eb97e52072bffd66cd687702fa47102d6359e229 Mon Sep 17 00:00:00 2001 From: Stepan Mikhailiuk Date: Thu, 4 Jan 2024 13:24:54 -0800 Subject: [PATCH] fix(*): fix github actions --- .github/workflows/publish-npm.yml | 7 +++++++ scripts/install_beamcoder_dependencies.sh | 25 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 scripts/install_beamcoder_dependencies.sh diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 1ccd6ce..8526bae 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -4,12 +4,17 @@ name: Node.js Package on: + push: + branches: [ "add-ci" ] release: types: [created] jobs: publish-npm: runs-on: ubuntu-latest + env: + CPATH: /tmp/framefusion/.ffmpeg/ffmpeg/include/ + PKG_CONFIG_PATH: /tmp/framefusion/.ffmpeg/ffmpeg/lib/pkgconfig/ steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -18,6 +23,8 @@ jobs: registry-url: https://registry.npmjs.org/ - run: mkdir /tmp/beamcoder - run: cp -r . /tmp/beamcoder + - run: cp -r . /tmp/framefusion + - run: sudo ./scripts/install_beamcoder_dependencies.sh - run: yarn install --frozen-lockfile working-directory: /tmp/beamcoder - run: yarn publish diff --git a/scripts/install_beamcoder_dependencies.sh b/scripts/install_beamcoder_dependencies.sh new file mode 100755 index 0000000..bf032b6 --- /dev/null +++ b/scripts/install_beamcoder_dependencies.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +ARCH=$(uname -m) + +if [[ "$ARCH" == "x86_64" ]]; then + echo "Detected 64 bit intel" + BINARIES_URL="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n5.1-latest-linux64-gpl-shared-5.1.tar.xz" +elif [[ "$ARCH" == "aarch64" ]]; then + # ARM linux setup + echo "Detected ARM" + BINARIES_URL="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n5.1-latest-linuxarm64-gpl-shared-5.1.tar.xz" +else + echo "\n\n\UNSUPPORTED ARCH $ARCH\n\n\n" + exit 1 +fi + +rm -rf ./.ffmpeg +mkdir ./.ffmpeg +cd ./.ffmpeg +wget $BINARIES_URL -O ffmpeg.tar.xz +tar -xf ffmpeg.tar.xz +rm ffmpeg.tar.xz +mv $(ls -1) ffmpeg + +ldconfig $(realpath .)/ffmpeg/lib/