librgaのurlの記載ミスを修正。 #57
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 Linux Packages | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- dockerimg: ubuntu2004 | |
pkgtype: deb | |
- dockerimg: ubuntu2204 | |
pkgtype: deb | |
- dockerimg: ubuntu2404 | |
pkgtype: deb | |
env: | |
DOCKER_FILE: docker/docker_${{ matrix.dockerimg }} | |
DOCKER_IMAGE: ${{ matrix.dockerimg }} | |
PKG_TYPE: ${{ matrix.pkgtype }} | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare | |
id: prep | |
run: | | |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##") | |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") | |
IMAGE="build_rkmppenc_"${{ env.DOCKER_IMAGE }} | |
TAG=$(echo $GITHUB_SHA | head -c7) | |
NPROC=$(grep 'processor' /proc/cpuinfo | wc -l) | |
OUTPUT_DIR=`pwd`/../output | |
LOCAL_USER_ID=$(id -u) | |
LOCAL_GROUP_ID=$(id -g) | |
echo "tagged_image=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT | |
echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
echo "nproc=${NPROC}" >> $GITHUB_OUTPUT | |
echo "output_dir=${OUTPUT_DIR}" >> $GITHUB_OUTPUT | |
echo "local_user_id=${LOCAL_USER_ID}" >> $GITHUB_OUTPUT | |
echo "local_group_id=${LOCAL_GROUP_ID}" >> $GITHUB_OUTPUT | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Checkout dependencies | |
run: | | |
git clone https://github.com/AviSynth/AviSynthPlus.git AviSynthPlus | |
git clone https://github.com/vapoursynth/vapoursynth.git vapoursynth | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ github.ref }}-${{ env.DOCKER_IMAGE }}-${{ github.sha }} | |
restore-keys: | | |
${{ github.ref }}-${{ env.DOCKER_IMAGE }}-${{ github.sha }} | |
${{ github.ref }}-${{ env.DOCKER_IMAGE }} | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Docker image | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ${{ env.DOCKER_FILE }} | |
builder: ${{ steps.buildx.outputs.name }} | |
platforms: linux/arm64 | |
push: false | |
load: true | |
tags: ${{ steps.prep.outputs.tagged_image }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
build-args: | | |
LOCAL_USER_ID=${{ steps.prep.outputs.local_user_id }} | |
LOCAL_GROUP_ID=${{ steps.prep.outputs.local_group_id }} | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
- name: Create Output Dir | |
run: | | |
mkdir -p ${{ steps.prep.outputs.output_dir }} | |
- name: Build Exec | |
id: build_exec | |
run: | | |
docker run -dit --rm --platform linux/arm64 -v ${{ steps.prep.outputs.output_dir }}:/output -u "$(id -u):$(id -g)" --name build_pkg ${{ steps.prep.outputs.tagged_image }} | |
docker exec build_pkg sh -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && . ~/.cargo/env && cargo install cargo-c" | |
docker exec build_pkg sh -c ". ~/.cargo/env && ./configure --libav-static --extra-cxxflags="-I./AviSynthPlus/avs_core/include -I./vapoursynth/include" --enable-lto" | |
docker exec build_pkg make -j${{ steps.prep.outputs.nproc }} | |
docker exec build_pkg ./rkmppenc --version | |
docker exec build_pkg ./check_options.py | |
docker exec build_pkg ./build_${{ env.PKG_TYPE }}.sh | |
docker exec build_pkg sh -c "cp -v ./*.${{ env.PKG_TYPE }} /output/" | |
PKGFILE=`ls ${{ steps.prep.outputs.output_dir }}/*.${{ env.PKG_TYPE }}` | |
echo ${PKGFILE} | |
echo "pkgfile=${PKGFILE}" >> $GITHUB_OUTPUT | |
- name: Normalize path and get filename | |
id: normalize_path | |
run: | | |
normalized_path=$(realpath "${{ steps.build_exec.outputs.pkgfile }}") | |
filename=$(basename "${{ steps.build_exec.outputs.pkgfile }}") | |
echo "Normalized path: $normalized_path" | |
echo "Filename: $filename" | |
echo "normalized_path=$normalized_path" >> $GITHUB_OUTPUT | |
echo "filename=$filename" >> $GITHUB_OUTPUT | |
- name: Calc hash | |
id: calc_hash | |
run: | | |
7z h -scrc* ${{ steps.build_exec.outputs.pkgfile }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.normalize_path.outputs.filename }} | |
path: ${{ steps.normalize_path.outputs.normalized_path }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: ${{ steps.build_exec.outputs.pkgfile }} |