|
| 1 | +name: GitHub CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: # |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-linux: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Git checkout |
| 13 | + uses: actions/checkout@v3 |
| 14 | + - name: Install dependencies |
| 15 | + run: | |
| 16 | + sudo apt-get update |
| 17 | + sudo apt-get install cmake git ninja-build checkinstall |
| 18 | + sudo apt-get install -y --no-install-recommends build-essential g++ gcc libass-dev pkg-config |
| 19 | + git clone https://github.com/AviSynth/AviSynthPlus avsplus |
| 20 | + cd avsplus |
| 21 | + cmake -G "Ninja" -B avisynth-build -S . |
| 22 | + cd avisynth-build |
| 23 | + ninja |
| 24 | + sudo checkinstall --pkgname=avisynth --pkgversion="$(grep -r Version avs_core/avisynth.pc | cut -f2 -d " ")-$(date --rfc-3339=date | sed 's/-//g')-git" --backup=no --deldoc=yes --delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes --fstrans=no --default ninja install |
| 25 | + - name: Build binary |
| 26 | + run: | |
| 27 | + cmake -B build -S . |
| 28 | + cmake --build build --clean-first |
| 29 | + - name: Copy binary |
| 30 | + run: cmake -E copy "build/src/libassrender.so" "dist/libassrender.so" |
| 31 | + - name: Upload artifact |
| 32 | + uses: actions/upload-artifact@v2 |
| 33 | + with: |
| 34 | + name: assrender_bin_linux |
| 35 | + path: dist |
| 36 | + |
| 37 | + build-win: |
| 38 | + runs-on: windows-2019 |
| 39 | + steps: |
| 40 | + - name: Git checkout |
| 41 | + uses: actions/checkout@v3 |
| 42 | + - name: Install dependencies |
| 43 | + run: | |
| 44 | + git submodule update --init --recursive |
| 45 | + git clone https://github.com/ShiftMediaProject/VSYASM.git |
| 46 | + .\VSYASM\install_script.bat |
| 47 | + git clone https://github.com/ShiftMediaProject/VSNASM.git |
| 48 | + .\VSNASM\install_script.bat |
| 49 | + md avsplus |
| 50 | + # - name: Install MSYS2 with dependencies |
| 51 | + # uses: msys2/setup-msys2@v2 |
| 52 | + # with: |
| 53 | + # update: true |
| 54 | + # install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libass |
| 55 | + # msystem: MINGW64 |
| 56 | + # path-type: inherit |
| 57 | + - name: Parse AviSynth+ release metadata |
| 58 | + uses: actions/github-script@v6 |
| 59 | + with: |
| 60 | + script: | |
| 61 | + const req = await github.request('https://api.github.com/repos/avisynth/avisynthplus/releases'); |
| 62 | + const data = req.data; |
| 63 | + let link = ''; |
| 64 | + for(let rel of data){ |
| 65 | + if(rel.prerelease||rel.draft){ |
| 66 | + continue; |
| 67 | + } |
| 68 | + for(let asset of rel.assets){ |
| 69 | + if(asset.name.match(/-filesonly.7z$/i)){ |
| 70 | + link = asset.browser_download_url; |
| 71 | + } |
| 72 | + } |
| 73 | + if(link != ''){ |
| 74 | + break; |
| 75 | + } |
| 76 | + } |
| 77 | + core.exportVariable('PACKAGE_URL', link); |
| 78 | + - name: Download AviSynth+ latest release |
| 79 | + run: curl -L "${{ env.PACKAGE_URL }}" -o "./avsplus/avisynthplus-latest-filesonly.7z" |
| 80 | + - name: Move libs files |
| 81 | + run: | |
| 82 | + 7z e "avsplus\*-filesonly.7z" -o"lib\x86-32" "*\x86\c_api\AviSynth.lib" |
| 83 | + 7z e "avsplus\*-filesonly.7z" -o"lib\x86-64" "*\x64\c_api\AviSynth.lib" |
| 84 | + - name: Add MSBuild to PATH |
| 85 | + uses: microsoft/setup-msbuild@v1 |
| 86 | + - name: Build x86 binary |
| 87 | + run: MSBuild.exe /t:Rebuild /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=x86 |
| 88 | + - name: Build x64 binary |
| 89 | + run: MSBuild.exe /t:Rebuild /p:PlatformToolset=v142 /m /p:Configuration=Release /p:Platform=x64 |
| 90 | + # - name: Build MINGW64 binary |
| 91 | + # shell: msys2 {0} |
| 92 | + # run: | |
| 93 | + # cmake -G "MinGW Makefiles" -B build -S . |
| 94 | + # cmake --build build --config Release --clean-first |
| 95 | + - name: Copy x86 binary |
| 96 | + run: cmake -E copy "bin\Release_Win32\assrender.dll" "dist\Release_x86\assrender.dll" |
| 97 | + - name: Copy x64 binary |
| 98 | + run: cmake -E copy "bin\Release_x64\assrender.dll" "dist\Release_x64\assrender.dll" |
| 99 | + # - name: Copy MINGW64 binary |
| 100 | + # run: cmake -E copy "build\src\assrender.dll" "dist\Release_MINGW64\assrender.dll" |
| 101 | + - name: Upload artifact |
| 102 | + uses: actions/upload-artifact@v2 |
| 103 | + with: |
| 104 | + name: assrender_bin_win |
| 105 | + path: dist |
0 commit comments