From 28a660727a5314448bd9de8e40f59e35efc6716d Mon Sep 17 00:00:00 2001 From: ArchieMeng Date: Tue, 24 Aug 2021 19:38:13 +0800 Subject: [PATCH] Update Github Actions --- .github/workflows/CI.yml | 18 ++++++++---------- .github/workflows/release.yml | 36 +++++++++++------------------------ 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f6ae583..c1ac0ba 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,6 +2,7 @@ name: CI on: [push, pull_request] env: DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer + APPNAME_SHORT: rife jobs: windows: runs-on: windows-latest @@ -39,9 +40,8 @@ jobs: $env:SWIG_DIR="$(pwd)\SWIG" $env:SWIG_EXECUTABLE="$(pwd)\SWIG\swig.exe" $env:PATH="$env:PATH;$env:SWIG_DIR" - mkdir build; cd build - cmake -A x64 ../src - cmake --build . --config Release -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build --config Release -j 2 ubuntu: # no needs to install swig for it is already there runs-on: ubuntu-latest @@ -65,9 +65,8 @@ jobs: - name: build run: | export VULKAN_SDK=`pwd`/1.2.162.0/x86_64 - mkdir build && cd build - cmake ../src - cmake --build . -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build -j 2 ubuntu-1804: # no needs to install swig for it is already there runs-on: ubuntu-18.04 @@ -91,9 +90,8 @@ jobs: - name: build run: | export VULKAN_SDK=`pwd`/1.2.162.0/x86_64 - mkdir build && cd build - cmake ../src - cmake --build . -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build -j 2 macos: runs-on: macos-latest @@ -125,7 +123,7 @@ jobs: cmake -DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" \ -DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/include \ -DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a \ - ../src + ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python cmake --build . -j 3 # - name: build-arm64 # run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04ab612..1114c71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: env: DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer APPLICATION_NAME: rife-ncnn-vulkan-python + APPNAME_SHORT: rife jobs: @@ -48,17 +49,13 @@ jobs: - name: build run: | export VULKAN_SDK=`pwd`/1.2.162.0/x86_64 - mkdir build && cd build - cmake ../src - cmake --build . -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build -j 2 - name: package run: | mkdir -p ${{ env.PACKAGENAME }} cp README.md LICENSE ${{ env.PACKAGENAME }} - cp build/rife_ncnn_vulkan.py ${{ env.PACKAGENAME }} - cp build/rife_ncnn_vulkan_wrapper.py ${{ env.PACKAGENAME }} - cp build/_rife_ncnn_vulkan_wrapper.so ${{ env.PACKAGENAME }} - cp -r models/ ${{ env.PACKAGENAME }} + cp -r build/${{ env.APPNAME_SHORT }}_ncnn_vulkan_python/* ${{ env.PACKAGENAME }} zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }} - name: upload uses: actions/upload-artifact@v2 @@ -91,17 +88,13 @@ jobs: - name: build run: | export VULKAN_SDK=`pwd`/1.2.162.0/x86_64 - mkdir build && cd build - cmake ../src - cmake --build . -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build -j 2 - name: package run: | mkdir -p ${{ env.PACKAGENAME }} cp README.md LICENSE ${{ env.PACKAGENAME }} - cp build/rife_ncnn_vulkan.py ${{ env.PACKAGENAME }} - cp build/rife_ncnn_vulkan_wrapper.py ${{ env.PACKAGENAME }} - cp build/_rife_ncnn_vulkan_wrapper.so ${{ env.PACKAGENAME }} - cp -r models/ ${{ env.PACKAGENAME }} + cp -r build/${{ env.APPNAME_SHORT }}_ncnn_vulkan_python/* ${{ env.PACKAGENAME }} zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }} - name: upload uses: actions/upload-artifact@v2 @@ -225,10 +218,7 @@ jobs: run: | mkdir -p ${{ env.PACKAGENAME }} cp README.md LICENSE ${{ env.PACKAGENAME }} - cp build-x86_64/rife_ncnn_vulkan.py ${{ env.PACKAGENAME }} - cp build-x86_64/rife_ncnn_vulkan_wrapper.py ${{ env.PACKAGENAME }} - cp build-x86_64/_rife_ncnn_vulkan_wrapper.so ${{ env.PACKAGENAME }} - cp -r models/ ${{ env.PACKAGENAME }} + cp -r build-x86_64/${{ env.APPNAME_SHORT }}_ncnn_vulkan_python/* ${{ env.PACKAGENAME }} zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }} - name: upload uses: actions/upload-artifact@v2 @@ -275,20 +265,16 @@ jobs: $env:SWIG_DIR="$(pwd)\SWIG" $env:SWIG_EXECUTABLE="$(pwd)\SWIG\swig.exe" $env:PATH="$env:PATH;$env:SWIG_DIR" - mkdir build; cd build - cmake -A x64 ../src - cmake --build . --config Release -j 2 + cmake -A x64 -B build ../${{ env.APPNAME_SHORT }}_ncnn_vulkan_python + cmake --build build --config Release -j 2 - name: package run: | mkdir ${{ env.PACKAGENAME }} ls build Copy-Item -Verbose -Path "README.md" -Destination "${{ env.PACKAGENAME }}" Copy-Item -Verbose -Path "LICENSE" -Destination "${{ env.PACKAGENAME }}" - Copy-Item -Verbose -Path "src\rife_ncnn_vulkan.py" -Destination "${{ env.PACKAGENAME }}" - Copy-Item -Verbose -Path "build\rife_ncnn_vulkan_wrapper.py" -Destination "${{ env.PACKAGENAME }}" - Copy-Item -Verbose -Path "build\Release\_rife_ncnn_vulkan_wrapper.pyd" -Destination "${{ env.PACKAGENAME }}" Copy-Item -Verbose -Path "C:\windows\system32\vcomp140.dll" -Destination "${{ env.PACKAGENAME }}" - Copy-Item -Verbose -Recurse -Path "models" -Destination "${{ env.PACKAGENAME }}" + Copy-Item -Verbose -Recurse -Path build\${{ env.APPNAME_SHORT }}_ncnn_vulkan_python\* -Destination "${{ env.PACKAGENAME }}" 7z a -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }} - name: upload uses: actions/upload-artifact@v2