Added Build Action #40
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
name: build | |
on: | |
push: | |
paths-ignore: | |
- "**.md" | |
- "LICENSE" | |
- "NOTICE" | |
- ".gitignore" | |
tags: | |
- "*" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- name: linux-x86_64 | |
- name: linux-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: Install dependencies | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qq nasm | |
if [[ "${{ matrix.platform.name }}" == "linux-arm64" ]]; then | |
sudo apt-get install -qq g++-aarch64-linux-gnu qemu-user | |
fi | |
- name: Install Python Requirements | |
run: python -m pip install meson ninja | |
- name: Configure with Meson | |
if: matrix.platform.name == 'linux-x86_64' | |
run: | | |
python -m mesonbuild.mesonmain setup build_output --prefix=$(pwd)/build_output --libdir=lib --buildtype=release --default-library=static | |
- name: Configure with Meson (arm64) | |
if: matrix.platform.name == 'linux-arm64' | |
run: | | |
python -m mesonbuild.mesonmain setup build_output --cross-file cross_arm64.ini --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 | |
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 }} |