Publish #78
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - Creates a release on matching tag push | |
# - builds latest minimal ffmpeg for wheels | |
# - builds new emscripten wasm | |
# - uploads release assets | |
# - updates lavavu.github.io repo | |
name: Publish | |
# Build on every branch push, tag push, and pull request change where tag matches a version release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
needs: ffmpeg #Required to prevent the subsequent deploy jobs running until this job finishes | |
steps: | |
- uses: mymindstorm/setup-emsdk@v7 | |
- name: Verify | |
run: emcc -v | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install prereqs | |
run: python -m pip install -r requirements.txt | |
- name: Build/install | |
run: make emscripten | |
- name: Zip | |
run: | | |
zip --junk-paths LavaVu-web ./lavavu/html/webview.html ./lavavu/html/LavaVu.wasm ./lavavu/html/LavaVu.data ./lavavu/html/LavaVu-amalgamated.js ./lavavu/html/LavaVu-amalgamated.css | |
# https://github.community/t/how-to-get-just-the-tag-name/16241/6 | |
- name: Get the version | |
id: get_version | |
run: | | |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
echo ::set-output name=VERSIONSTR::v${GITHUB_REF/refs\/tags\//} | |
- name: Create release | |
id: upload-release-asset | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
#This will not trigger "publish" actions if we use GITHUB_TOKEN | |
#See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token | |
#repo_token: ${{ secrets.GITHUB_TOKEN }} | |
repo_token: ${{ secrets.LAVAVU_PUSH }} | |
file: LavaVu-web.zip | |
asset_name: LavaVu-web-$tag.zip | |
tag: ${{ github.ref }} #Use current tag/ref | |
overwrite: true | |
body: "Release LavaVu ${{ steps.get_version.outputs.VERSIONSTR }}" | |
release_name: ${{ steps.get_version.outputs.VERSIONSTR }} | |
- name: Push files to lavavu.github.io | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.LAVAVU_PUSH }} | |
run: | | |
git config --global user.name "okaluza" | |
git config --global user.email "[email protected]" | |
git clone --depth 1 --single-branch --branch main https://[email protected]/lavavu/lavavu.github.io | |
cd lavavu.github.io | |
git checkout main | |
cp ../lavavu/html/webview.html . | |
cp ../lavavu/html/LavaVu.wasm . | |
cp ../lavavu/html/LavaVu.data . | |
cp ../lavavu/html/LavaVu-amalgamated.js . | |
cp ../lavavu/html/LavaVu-amalgamated.css . | |
git stage * | |
git commit -m "Update LavaVu emscripten release" | |
git tag ${{ steps.get_version.outputs.VERSION }} | |
git push origin --tags | |
ffmpeg: | |
# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
runs-on: ubuntu-latest | |
container: quay.io/pypa/manylinux_2_28_x86_64 | |
steps: | |
- name: Install deps | |
run: | | |
dnf install -y autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel zip | |
- name: Build nasm | |
run: | | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2 | |
tar xjf nasm-2.15.05.tar.bz2 | |
cd nasm-2.15.05 | |
./autogen.sh | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" | |
make -j$(nproc) | |
make install | |
- name: Build yasm | |
run: | | |
cd ~/ffmpeg_sources | |
curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar xzf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0 | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" | |
make -j$(nproc) | |
make install | |
- name: Build x264 | |
run: | | |
cd ~/ffmpeg_sources | |
git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git | |
cd x264 | |
export PATH="$HOME/bin:$PATH" | |
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-shared | |
make -j$(nproc) | |
make install | |
- name: Build ffmpeg | |
run: | | |
cd ~/ffmpeg_sources/ | |
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 | |
tar xjf ffmpeg-snapshot.tar.bz2 | |
cd ffmpeg | |
export PATH="$HOME/bin:$PATH" | |
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include -fPIC -m64" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --extra-libs=-lpthread --extra-libs=-lm --bindir="$HOME/bin" --enable-gpl --enable-libfreetype --enable-libx264 --enable-nonfree --enable-shared --enable-pic --extra-ldexeflags=-pie | |
make -j$(nproc) | |
make install | |
- name: Zip | |
run: | | |
cd ~/ffmpeg_build/; rm -rf lib/*.a; zip --symlinks -r /ffmpeg-mini lib/* include/* | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ffmpeg-mini | |
path: /ffmpeg-mini.zip | |
ffmpeg-upload: | |
runs-on: ubuntu-latest | |
needs: [build, ffmpeg] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ffmpeg-mini | |
- name: Upload ffmpeg build to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ffmpeg-mini.zip | |
asset_name: ffmpeg-mini.zip | |
tag: ${{ github.ref }} | |