Skip to content

Commit

Permalink
fix(*): fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancar committed Jan 4, 2024
1 parent ab8ba67 commit eb97e52
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions scripts/install_beamcoder_dependencies.sh
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit eb97e52

Please sign in to comment.