Build for Windows #31
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 for Windows | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'which tag to upload to' | |
default: '' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ windows-latest ] | |
arch: [ x64 ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Cache fftw3 | |
id: cache-fftw3 | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/vcpkg/installed/ | |
key: ${{ runner.os }}-fftw3-v1 | |
- name: Run vcpkg | |
uses: lukka/run-vcpkg@v7 | |
if: steps.cache-fftw3.outputs.cache-hit != 'true' | |
with: | |
vcpkgArguments: 'fftw3[avx2,threads]:x64-windows-static' | |
vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
vcpkgGitCommitId: 5568f110b509a9fd90711978a7cb76bae75bb092 # 2021.05.12 release | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: install meson and ninja | |
run: pip install meson ninja | |
- name: Plug in vs-api3 | |
shell: bash | |
run: | | |
git clone https://github.com/AmusementClub/vs-api3 --depth=1 --branch master api3 | |
cp api3/api3.cc . | |
sed -i -e "/Plugin.cpp'/s//&, 'api3.cc'/" meson.build | |
cat meson.build | |
- name: download VS headers and patch header location | |
shell: bash | |
run: | | |
git clone https://github.com/AmusementClub/vapoursynth-classic --depth=1 --branch doodle2 vapoursynth | |
cp vapoursynth/include/*.h . | |
sed -i -e '/#include <V/y|<>|""|' *.cpp *.h | |
- name: setup MS dev commands | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Install pkg-config lite | |
run: choco install pkgconfiglite | |
- name: Meson setup | |
run: meson setup builddir/ -Db_vscrt=mt -Dpkg_config_path=${{ github.workspace }}/vcpkg/installed/x64-windows-static/lib/pkgconfig | |
env: | |
CXX: clang-cl | |
CXXFLAGS: "-mavx -mfma -Xclang -ffast-math" | |
- name: Meson compile | |
run: meson compile -C builddir/ -v | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: release-${{matrix.arch}} | |
path: | | |
builddir/*.dll | |
- name: Compress artifact for release | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' | |
shell: cmd | |
run: | | |
cd builddir | |
mkdir vs-fft3dfilter-windows-${{ github.event.inputs.tag }} | |
xcopy fft3dfilter.dll vs-fft3dfilter-windows-${{ github.event.inputs.tag }} /f | |
7z a -t7z -mx=9 ../vs-fft3dfilter-windows-${{ github.event.inputs.tag }}.7z vs-fft3dfilter-windows-${{ github.event.inputs.tag }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' | |
with: | |
tag_name: ${{ github.event.inputs.tag }} | |
files: | | |
vs-fft3dfilter-windows-${{ github.event.inputs.tag }}.7z | |
fail_on_unmatched_files: true | |
generate_release_notes: false | |
prerelease: true |