改行コードの変更。 #234
This file contains hidden or 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 | |
| - linux | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - dockerimg: ubuntu2004 | |
| pkgtype: deb | |
| - dockerimg: ubuntu2204 | |
| pkgtype: deb | |
| - dockerimg: ubuntu2404 | |
| pkgtype: deb | |
| - dockerimg: fedora41 | |
| pkgtype: rpm | |
| env: | |
| DOCKER_IMAGE: ${{ matrix.dockerimg }} | |
| PKG_TYPE: ${{ matrix.pkgtype }} | |
| BASE_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/vceenc-build | |
| FFMPEG_PREFIX: /opt/build_scripts/ffmpeg_dll/build_dll/x64/build | |
| 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") | |
| NPROC=$(grep 'processor' /proc/cpuinfo | wc -l) | |
| OUTPUT_DIR=`pwd`/output | |
| LOCAL_USER_ID=$(id -u) | |
| LOCAL_GROUP_ID=$(id -g) | |
| BASE_IMAGE="${{ env.BASE_IMAGE_REPO }}:${{ env.DOCKER_IMAGE }}" | |
| echo "base_image=${BASE_IMAGE}" >> $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: Verify tag matches VER_STR_FILEVERSION | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| cd ${{ github.workspace }} | |
| TAG=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") | |
| VER=$(sed -n 's/^#define VER_STR_FILEVERSION[ \t]*"\([^"]*\)".*$/\1/p' VCECore/rgy_version.h | tr -d '\r\n') | |
| if [ "$TAG" = "$VER" ] || [ "${TAG#v}" = "$VER" ]; then | |
| echo "Version OK: tag=${TAG}, header=${VER}" | |
| else | |
| echo "ERROR: Tag version (${TAG}) does not match VER_STR_FILEVERSION (${VER})" >&2 | |
| exit 1 | |
| fi | |
| - name: Checkout dependencies | |
| run: | | |
| git clone --depth 1 https://github.com/AviSynth/AviSynthPlus.git AviSynthPlus | |
| git clone -b R72 --depth 1 https://github.com/vapoursynth/vapoursynth.git vapoursynth | |
| - name: Pull base image | |
| run: docker pull ${{ steps.prep.outputs.base_image }} | |
| - name: Create Output Dir | |
| run: | | |
| mkdir -p ${{ steps.prep.outputs.output_dir }} | |
| - name: Build Exec | |
| id: build_exec | |
| run: | | |
| docker run -dit --rm \ | |
| -v ${{ github.workspace }}:/work \ | |
| -v ${{ steps.prep.outputs.output_dir }}:/output \ | |
| -u "$(id -u):$(id -g)" \ | |
| --workdir /work \ | |
| --name build_pkg ${{ steps.prep.outputs.base_image }} | |
| docker exec build_pkg bash -lc ' | |
| FFPKG="${{ env.FFMPEG_PREFIX }}/lib/pkgconfig:${{ env.FFMPEG_PREFIX }}/lib/x86_64-linux-gnu/pkgconfig" | |
| export PKG_CONFIG_PATH="${FFPKG}${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" | |
| meson setup ./build . --buildtype=release -Db_lto=true -Dcpp_args="['\''-I/work/AviSynthPlus/avs_core/include'\'','\''-I/work/vapoursynth/include'\'']" | |
| ' | |
| docker exec build_pkg bash -lc "meson compile -C ./build -j${{ steps.prep.outputs.nproc }}" | |
| docker exec build_pkg ldd ./build/vceencc | |
| docker exec build_pkg ./build/vceencc --version | |
| docker exec build_pkg ./check_options.py -exe ./build/vceencc | |
| docker exec build_pkg cp ./build/vceencc ./vceencc | |
| docker exec build_pkg ./build_${{ env.PKG_TYPE }}.sh | |
| docker exec build_pkg bash -lc "cp -v ./*.${{ env.PKG_TYPE }} /output/" | |
| PKGFILE=`ls ${{ steps.prep.outputs.output_dir }}/*.${{ env.PKG_TYPE }}` | |
| echo ${PKGFILE} | |
| echo "pkgfile=${PKGFILE}" >> $GITHUB_OUTPUT | |
| - name: Calc hash | |
| id: calc_hash | |
| run: | | |
| 7z h -scrc* ${{ steps.build_exec.outputs.pkgfile }} | |
| - 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 }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nvencc_${{ matrix.dockerimg }}_${{ matrix.pkgtype }} | |
| path: ${{ steps.build_exec.outputs.pkgfile }} |