From 06571e86c8a3f05417a9b1c68cd721e8b014bdd4 Mon Sep 17 00:00:00 2001 From: Oneric Date: Tue, 16 Aug 2022 23:53:30 +0200 Subject: [PATCH] Add GHA CI and publish nightly builds --- .github/workflows/build.yml | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3cd91bae --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,91 @@ +name: Build VSFilter + +on: + push: + branches: [ci, xy_sub_filter_rc*, vsfilter_rc*, master] + +jobs: + build: + runs-on: windows-2019 + strategy: + fail-fast: false + matrix: + include: + - msarch: x64 + vsfplat: x64 + namesuf: x86-64 + - arch: x86 + vsfplat: Win32 + namesuf: x86-32 + defaults: + run: + shell: 'bash' + + steps: + - name: Determine configuration + id: config + run: | + # base name of GHA artifact + name="VSFilter+SubFilter" + # space delimited list of filename stems to delete from artifact + delete="" + + # If it runs for one of the main XySubFilter or xy-VSFilter dev branches, + # only publish compatible binaries. If it's some other branch, it's probably + # a transient testing build, so keep everything. + # ref.: https://github.com/Cyberbeing/xy-VSFilter/pull/18#issuecomment-1302638201 + REF="${{ github.ref }}" + REF="${REF#refs/heads/}" + if [ "$REF" = "master" ] || [ "$REF" = "vsfilter_rc" ] ; then + name="VSFilter" + delete="XySubFilter" + # xy-VSFilter specific changes weren't merged back into the + # XySubFilter branch, so it normally shouldn't be used to build + # xy-VSFilter. But in pinterf/xy-VSFilter there’s only one branch. + #elif echo "$REF" | grep -qE '^xy_sub_filter_rc' ; then + # name="SubFilter" + # delete="VSFilter" + fi + + echo "name=$name" >> $GITHUB_OUTPUT + echo "delete=$delete" >> $GITHUB_OUTPUT + + - name: checkout code + uses: actions/checkout@v3 + with: + # We need full history to allow finding the tag in build prep + fetch-depth: 0 + + - name: install yasm + shell: cmd + run: | + git clone --depth=1 https://github.com/ShiftMediaProject/VSYASM.git + .\VSYASM\install_script.bat + + # VS2019 is 16.x; VS2022 17.x + - name: Setup VS2019 + uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: matrix.msarch + # vs-version: '[16.01,16.11]' + + - name: Build xy-VSFilter and/or XySubFilter + run: | + export VS160COMNTOOLS="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/" + bash ./build_vsfilter.sh -platform "${{ matrix.vsfplat }}" -compiler VS2019 + + - name: Prune incompatible files + if: steps.config.outputs.delete != '' + run: | + for dir in bin/lib*/*/Release ; do + for bn in ${{ steps.config.outputs.delete }} ; do + rm -f "$dir"/"$bn".* + done + done + + - name: Publish output + uses: actions/upload-artifact@v3 + with: + name: xy-${{ steps.config.outputs.name }}_nightly_${{ matrix.namesuf }} + path: | + bin/lib*/*/Release