Skip to content

Merge remote-tracking branch 'upstream/master' #54

Merge remote-tracking branch 'upstream/master'

Merge remote-tracking branch 'upstream/master' #54

Workflow file for this run

name: build
on:
push:
paths-ignore:
- "**.md"
- "LICENSE"
- "NOTICE"
- ".gitignore"
tags:
- "*"
jobs:
build-linux:
runs-on: ${{ matrix.platform.host }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux-x86_64
arch: x86_64
host: ubuntu-latest
- name: linux-arm64
arch: arm64
host: arm64-server
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.platform.name == 'linux-arm64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Docker Build
run: |
docker run -v $(pwd):/app -w /app ghcr.io/pytgcalls/ntgcalls/${{ matrix.platform.arch }}:latest bash -c "
yum install -y nasm
python3.12 -m venv venv
source venv/bin/activate
python -m pip install meson ninja --root-user-action=ignore
python -m mesonbuild.mesonmain setup build_output --prefix=/app/build_output --libdir=lib --buildtype=release --default-library=static
python -m ninja -C build_output
python -m ninja -C build_output install
chown -R $(id -u):$(id -g) build_output"
- name: Prepare for artifact
run: |
mkdir -p artifacts/lib
mv build_output/lib/libopenh264.a artifacts/lib/
mv build_output/include artifacts/
tar -czvf openh264.${{ matrix.platform.name }}.tar.gz artifacts
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: openh264.${{ matrix.platform.name }}.tar.gz
path: openh264.${{ matrix.platform.name }}.tar.gz
build-windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
platform:
- name: windows-x86_64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install dependencies
run: choco install -y nasm
- name: Add NASM to PATH
run: echo "C:\Program Files\NASM" >> $env:GITHUB_PATH
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Build Pre-Requisites
run: |
make OS=msvc gmp-bootstrap
make OS=msvc gtest-bootstrap
- working-directory: ./build
run: ./AutoBuildForWindows.bat Win64-Release-ASM
- name: Prepare for artifact
run: |
mkdir artifacts/lib
mkdir artifacts/include/wels
move openh264.lib artifacts/lib/
move codec/api/wels/*.h artifacts/include/wels/
Compress-Archive -Path artifacts -DestinationPath openh264.${{ matrix.platform.name }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: openh264.${{ matrix.platform.name }}.zip
path: openh264.${{ matrix.platform.name }}.zip
build-macos:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
platform:
- name: macos-arm64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Python Requirements
run: |
python -m pip install --upgrade pip
python -m pip install meson ninja
- name: Install Python Requirements
run: python -m pip install meson ninja
- name: Build with Meson
run: python -m mesonbuild.mesonmain setup build_output --prefix=$(pwd)/build_output --libdir=lib --buildtype=release --default-library=static
- name: Build with Ninja
run: python -m ninja -C build_output
- name: Install to build_output
run: python -m ninja -C build_output install
- name: Prepare for artifact
run: |
mkdir -p artifacts/lib
mv build_output/lib/libopenh264.a artifacts/lib/
mv build_output/include artifacts/
tar -czvf openh264.${{ matrix.platform.name }}.tar.gz artifacts
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: openh264.${{ matrix.platform.name }}.tar.gz
path: openh264.${{ matrix.platform.name }}.tar.gz
create-release:
name: Create Release
if: contains(github.ref, 'tags/v')
needs:
- build-windows
- build-macos
- build-linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download
with:
platform: windows-x86_64
- uses: ./.github/actions/download
with:
platform: macos-arm64
- uses: ./.github/actions/download
with:
platform: linux-x86_64
- uses: ./.github/actions/download
with:
platform: linux-arm64
- name: Env to output
run: |
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
cat package_paths.env >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
id: env
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.env.outputs.package_paths }}