Skip to content

Merge branch 'release/2024.1.0' into develop #623

Merge branch 'release/2024.1.0' into develop

Merge branch 'release/2024.1.0' into develop #623

Workflow file for this run

name: build
on:
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- 'THANKS'
- 'LICENSE'
- 'NOTICE'
push:
branches:
- main
- master
- develop
tags:
- 202*
paths-ignore:
- 'doc/**'
- '**.md'
- 'THANKS'
- 'LICENSE'
- 'NOTICE'
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04_x86_64
- ubuntu-20.04_arm64
- ubuntu-22.04_x86_64
- ubuntu-22.04_arm64
name: Build hisui for ${{ matrix.os }}
runs-on: ${{ contains(matrix.os, 'ubuntu-20.04') && 'ubuntu-20.04' || 'ubuntu-22.04' }}
steps:
- name: Install packages
shell: bash
run: |
sudo apt update
sudo apt install -yq yasm ccache libstdc++-10-dev-arm64-cross libc6-dev-arm64-cross binutils-aarch64-linux-gnu libva-dev libdrm-dev
sudo rm -rf /var/lib/apt/lists/*
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/checkout@v4
- name: Get vars
shell: bash
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Get versions
shell: bash
id: versions
run: |
source VERSION
echo "libvpx_version=${LIBVPX_VERSION}" >> "$GITHUB_OUTPUT"
echo "svt_av1_version=${SVT_AV1_VERSION}" >> "$GITHUB_OUTPUT"
- name: Cache libvpx ${{ steps.versions.outputs.libvpx_version }}
id: cache-libvpx
uses: actions/cache@v3
with:
path: third_party/libvpx
key: ${{ matrix.os }}-third_party-libvpx-${{ hashFiles(format('third_party/libvpx/{0}/libvpx.a', matrix.os)) }}
restore-keys: ${{ matrix.os }}-third_party-libvpx-
- name: Clear libvpx
if: steps.cache-libvpx.outputs.cache-hit != 'true'
run: rm -rf third_party/libvpx
- name: Cache SVT-AV1 ${{ steps.versions.outputs.svt_av1_version }}
id: cache-svt-av1
uses: actions/cache@v3
with:
path: third_party/SVT-AV1
key: ${{ matrix.os }}-third_party-svt-av1-${{ hashFiles('third_party/SVT-AV1/Bin/Release/libSvtAv1Dec.a', 'third_party/SVT-AV1/Bin/Release/libSvtAv1Enc.a') }}
restore-keys: ${{ matrix.os }}-third_party-svt-av1-
- name: Clear SVT-AV1
if: steps.cache-svt-av1.outputs.cache-hit != 'true'
run: rm -rf third_party/SVT-AV1
- name: Cache release directory
id: cache-release
uses: actions/cache@v3
with:
path: release/${{ matrix.os }}/_deps
key: ${{ matrix.os }}-release-deps-${{ hashFiles(format('release/{0}/Makefile', matrix.os)) }}
restore-keys: ${{ matrix.os }}-release-deps-
- name: Clear release directory
if: steps.cache-release.outputs.cache-hit != 'true'
run: rm -rf release
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
TZ=UTC echo "timestamp=$(TZ=UTC date +%Y-%m-%d-%H:%M:%S)" >> "$GITHUB_OUTPUT"
- name: Cache ~/.ccache directory
id: cache-ccache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ${{ matrix.os }}-ccache-dir-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ matrix.os }}-ccache-dir-
- name: Ccache stat
run: ccache -s
- name: Build hisui
run: ./build.bash ${{ matrix.os }} --package --use-ccache ${{ contains(matrix.os, '_x86_64') && '--with-test' || '' }}
timeout-minutes: 120
- name: Test hisui
if: contains(matrix.os, '_x86_64')
run: cmake --build release/${{ matrix.os }} --target test -- ARGS='-V -L hisui'
- name: Output package name
shell: bash
run: |
source VERSION
echo "PACKAGE_NAME=hisui-${HISUI_VERSION}_${{ matrix.os }}.tar.gz" >> ${{ matrix.os }}.env
echo "CONTENT_TYPE=application/gzip" >> ${{ matrix.os }}.env
echo "name=hisui-${HISUI_VERSION}_${{ matrix.os }}.tar.gz" >> "$GITHUB_OUTPUT"
id: package_name
- name: Upload hisui binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-hisui-binary
path: release/${{ matrix.os }}/hisui
if-no-files-found: error
- name: Upload hisui binary with hash
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-hisui-binary-${{ steps.vars.outputs.sha_short }}
path: release/${{ matrix.os }}/hisui
if-no-files-found: error
- name: Upload tarball
uses: actions/upload-artifact@v3
with:
name: ${{ steps.package_name.outputs.name }}
path: release/${{ matrix.os }}/${{ steps.package_name.outputs.name }}
if-no-files-found: error
- name: Upload environment
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}.env
path: ${{ matrix.os }}.env
if-no-files-found: error
- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_CHANNEL: hisui
SLACK_COLOR: danger
SLACK_TITLE: Failure build-linux ${{ matrix.os }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
push-to-dockerhub:
name: Push to DockerHub
if: contains(github.ref, 'tags/202')
needs:
- build-linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Mkdir release
shell: bash
run: |
mkdir -p release/ubuntu-20.04_x86_64
mkdir -p release/ubuntu-20.04_arm64
mkdir -p release/ubuntu-22.04_x86_64
mkdir -p release/ubuntu-22.04_arm64
- uses: actions/download-artifact@v3
with:
name: ubuntu-20.04_x86_64-hisui-binary
path: release/ubuntu-20.04_x86_64
- uses: actions/download-artifact@v3
with:
name: ubuntu-20.04_arm64-hisui-binary
path: release/ubuntu-20.04_arm64
- uses: actions/download-artifact@v3
with:
name: ubuntu-22.04_x86_64-hisui-binary
path: release/ubuntu-22.04_x86_64
- uses: actions/download-artifact@v3
with:
name: ubuntu-22.04_arm64-hisui-binary
path: release/ubuntu-22.04_arm64
- name: Chmod 755 hisui
shell: bash
run: |
chmod 755 release/ubuntu-20.04_x86_64/hisui
chmod 755 release/ubuntu-20.04_arm64/hisui
chmod 755 release/ubuntu-22.04_x86_64/hisui
chmod 755 release/ubuntu-22.04_arm64/hisui
- name: Get Versions
shell: bash
id: versions
run: |
source VERSION
echo "hisui_version=${HISUI_VERSION}" >> "$GITHUB_OUTPUT"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Push to DockerHub
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: shiguredo/hisui:${{ steps.versions.outputs.hisui_version }}-ubuntu-20.04
platforms: linux/amd64,linux/arm64
file: docker/Dockerfile
build-args: |
UBUNTU_VERSION=20.04
- name: Push to DockerHub
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: shiguredo/hisui:${{ steps.versions.outputs.hisui_version }}-ubuntu-22.04
platforms: linux/amd64,linux/arm64
file: docker/Dockerfile
build-args: |
UBUNTU_VERSION=22.04
- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_CHANNEL: hisui
SLACK_COLOR: danger
SLACK_TITLE: Failure push-to-dockerhub
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
create-release:
name: Create release
if: contains(github.ref, 'tags/202')
needs:
- build-linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download
with:
platform: ubuntu-20.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-20.04_arm64
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_arm64
- name: Env to output
run: |
{
echo "package_paths<<EOF"
cat package_paths.env
echo "EOF"
} >> "$GITHUB_OUTPUT"
id: env
- name: Release
uses: softprops/action-gh-release@v1
with:
files:
${{ steps.env.outputs.package_paths }}
- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_CHANNEL: hisui
SLACK_COLOR: danger
SLACK_TITLE: Failure upload-assets
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}