diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 00000000..a841b34b --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,57 @@ +name: Build and Upload Artifact + +on: + push: + branches: + - dev + +jobs: + build: + runs-on: windows-latest # We use Windows runner as MSBuild is used + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.0.2 # Set up MSBuild on the Windows runner + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: 5.15.2 + host: windows + target: desktop + arch: win64_msvc2019_64 + dir: ${{ runner.temp }} + setup-python: false + + - name: Prepare Qt environment + run: | + # Set Qt related environment variables + echo "QTDIR=${{ runner.temp }}/Qt/5.15.2/msvc2019_64" >> $GITHUB_ENV + echo "QTDIR/bin" >> $GITHUB_PATH + echo "QTDIR/lib" >> $GITHUB_PATH + echo "QTDIR/plugins" >> $GITHUB_PATH + + - name: Build the solution + run: + msbuild ${{ github.workspace }}\native\src\ReachVariantTool.sln /p:Configuration=Debug /p:Platform=x64 + + - name: Create artifact directory + run: mkdir artifact + + - name: Copy built files to artifact directory + run: | + robocopy x64\Debug artifact /E + + - name: Zip artifact directory + run: | + $zipPath = $env:GITHUB_WORKSPACE + '\artifact.zip' + Compress-Archive -Path $env:GITHUB_WORKSPACE\artifact -DestinationPath $zipPath + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: project-artifact + path: artifact.zip diff --git a/.github/worlflows/build.txt b/.github/worlflows/build.txt new file mode 100644 index 00000000..09bad363 --- /dev/null +++ b/.github/worlflows/build.txt @@ -0,0 +1,309 @@ +name: QMake Build Matrix + +on: [push] + +env: + QT_VERSION: 5.15.2 + QT_CREATOR_VERSION: 4.11.0 + PLUGIN_PRO: doxygen.pro + PLUGIN_NAME: Doxygen + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - { + name: "Windows Latest x64", artifact: "Windows-x64.zip", + os: windows-latest, + environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + } + - { + name: "Windows Latest x86", artifact: "Windows-x86.zip", + os: windows-latest, + environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars32.bat" + } + - { + name: "Linux Latest x64", artifact: "Linux-x64.zip", + os: ubuntu-latest + } + - { + name: "macOS Latest x64", artifact: "macOS-x64.zip", + os: macos-latest + } + + steps: + - uses: actions/checkout@v1 + + - name: Installing system libs + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Linux") + execute_process( + COMMAND sudo apt install libgl1-mesa-dev + ) + endif() + + - name: Download Qt + id: qt + shell: cmake -P {0} + run: | + set(qt_version $ENV{QT_VERSION}) + + string(REPLACE "." "" qt_version_dotless "${qt_version}") + if ("${{ runner.os }}" STREQUAL "Windows") + set(url_os "windows_x86") + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") + set(qt_package_name "qt.qt5.${qt_version_dotless}.win64_msvc2017_64") + set(qt_dir_prefix "${qt_version}/msvc2017_64") + elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + set(qt_package_name "qt.qt5.${qt_version_dotless}.win32_msvc2017") + set(qt_dir_prefix "${qt_version}/msvc2017") + else() + endif() + elseif ("${{ runner.os }}" STREQUAL "Linux") + set(url_os "linux_x64") + set(qt_package_name "qt.qt5.${qt_version_dotless}.gcc_64") + set(qt_dir_prefix "${qt_version}/gcc_64") + elseif ("${{ runner.os }}" STREQUAL "macOS") + set(url_os "mac_x64") + set(qt_package_name "qt.qt5.${qt_version_dotless}.clang_64") + set(qt_dir_prefix "${qt_version}/clang_64") + endif() + + set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt5_${qt_version_dotless}") + file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) + + file(READ ./Updates.xml updates_xml) + string(REGEX MATCH "${qt_package_name}.*([0-9+-.]+).*qtbase([a-zA-Z0-9_-]+).7z" + updates_xml_output "${updates_xml}") + set(package_version ${CMAKE_MATCH_1}) + set(package_suffix ${CMAKE_MATCH_2}) + string(REPLACE "-debug-symbols" "" package_suffix "${package_suffix}") + + # Workaround for CMake's greedy regex + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + string(REPLACE "X86_64" "X86" package_suffix "${package_suffix}") + endif() + + file(MAKE_DIRECTORY qt5) + + # Save the path for other steps + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt5/${qt_dir_prefix}" qt_dir) + message("::set-output name=qt_dir::${qt_dir}") + + foreach(package qtbase qtdeclarative qttools qtsvg) + file(DOWNLOAD + "${qt_base_url}/${qt_package_name}/${package_version}${package}${package_suffix}.7z" ./${package}.7z + SHOW_PROGRESS + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qt5) + endforeach() + + file(READ "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" qtconfig) + string(REPLACE "Enterprise" "OpenSource" qtconfig "${qtconfig}") + string(REPLACE "licheck.exe" "" qtconfig "${qtconfig}") + string(REPLACE "licheck64" "" qtconfig "${qtconfig}") + string(REPLACE "licheck_mac" "" qtconfig "${qtconfig}") + file(WRITE "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" "${qtconfig}") + + - name: Download Qt Creator + id: qt_creator + shell: cmake -P {0} + run: | + string(REGEX MATCH "([0-9]+.[0-9]+).[0-9]+" outvar "$ENV{QT_CREATOR_VERSION}") + set(qtc_base_url "https://download.qt.io/official_releases/qtcreator/${CMAKE_MATCH_1}/$ENV{QT_CREATOR_VERSION}") + + if ("${{ runner.os }}" STREQUAL "Windows") + set(qtc_output_directory "qtcreator/lib/qtcreator/plugins") + set(qtc_binary_name "$ENV{PLUGIN_NAME}4.dll") + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") + set(qtc_platform "windows_msvc2017_x64") + elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + set(qtc_platform "windows_msvc2017_x86") + endif() + elseif ("${{ runner.os }}" STREQUAL "Linux") + set(qtc_output_directory "qtcreator/lib/qtcreator/plugins") + set(qtc_binary_name "lib$ENV{PLUGIN_NAME}.so") + set(qtc_platform "linux_gcc_64_rhel72") + elseif ("${{ runner.os }}" STREQUAL "macOS") + set(qtc_output_directory "qtcreator/bin/Qt Creator.app/Contents/PlugIns") + set(qtc_binary_name "lib$ENV{PLUGIN_NAME}.dylib") + set(qtc_platform "mac_x64") + endif() + + # Save the path for other steps + message("::set-output name=qtc_binary_name::${qtc_binary_name}") + message("::set-output name=qtc_output_directory::${qtc_output_directory}") + + file(MAKE_DIRECTORY qtcreator) + + foreach(package qtcreator qtcreator_dev) + file(DOWNLOAD + "${qtc_base_url}/installer_source/${qtc_platform}/${package}.7z" ./${package}.7z SHOW_PROGRESS) + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qtcreator) + endforeach() + + if ("${{ runner.os }}" STREQUAL "macOS") + execute_process( + COMMAND ${CMAKE_COMMAND} -E make_directory qtcreator/bin + COMMAND ${CMAKE_COMMAND} -E create_symlink + "$ENV{GITHUB_WORKSPACE}/qtcreator/Qt Creator.app" + "$ENV{GITHUB_WORKSPACE}/qtcreator/bin/Qt Creator.app" + ) + endif() + + - name: Configure + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") + execute_process( + COMMAND "${{ matrix.config.environment_script }}" && set + OUTPUT_FILE environment_script_output.txt + ) + file(STRINGS environment_script_output.txt output_lines) + foreach(line IN LISTS output_lines) + if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") + set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") + + # Set for other steps + message("::set-env name=${CMAKE_MATCH_1}::${CMAKE_MATCH_2}") + endif() + endforeach() + endif() + + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qtcreator" qtcreator_dir) + + execute_process( + COMMAND ${{ steps.qt.outputs.qt_dir }}/bin/qmake + $ENV{PLUGIN_PRO} + CONFIG+=release + QTC_SOURCE="${qtcreator_dir}" + QTC_BUILD="${qtcreator_dir}" + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + + - name: Build + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Windows") + set(ENV{PATH} "${{ steps.qt.outputs.qt_dir }}/bin/;$ENV{PATH}") + else() + set(ENV{PATH} "${{ steps.qt.outputs.qt_dir }}/bin/:$ENV{PATH}") + set(ENV{LD_LIBRARY_PATH} "qtcreator/lib/Qt/lib:$ENV{LD_LIBRARY_PATH}") + endif() + + include(ProcessorCount) + ProcessorCount(N) + + set(make_program make -j ${N}) + if ("${{ runner.os }}" STREQUAL "Windows") + set(make_program "qtcreator/bin/jom") + endif() + + execute_process( + COMMAND ${make_program} + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}" artifact) + + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvf ${artifact} --format=zip "${{ steps.qt_creator.outputs.qtc_binary_name }}" + WORKING_DIRECTORY "${{ steps.qt_creator.outputs.qtc_output_directory }}" + ) + + - uses: actions/upload-artifact@v1 + id: upload_artifact + with: + path: ./${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + name: ${{ env.PLUGIN_NAME}}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + + release: + if: contains(github.ref, 'tags/v') + runs-on: ubuntu-latest + needs: build + + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Store Release url + run: | + echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url + + - uses: actions/upload-artifact@v1 + with: + path: ./upload_url + name: upload_url + + publish: + if: contains(github.ref, 'tags/v') + + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - { + name: "Windows Latest x64", artifact: "Windows-x64.zip", + os: ubuntu-latest + } + - { + name: "Windows Latest x86", artifact: "Windows-x86.zip", + os: ubuntu-latest + } + - { + name: "Linux Latest x64", artifact: "Linux-x64.zip", + os: ubuntu-latest + } + - { + name: "macOS Latest x64", artifact: "macOS-x64.zip", + os: macos-latest + } + needs: release + + steps: + - name: Download artifact + uses: actions/download-artifact@v1 + with: + name: ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + path: ./ + + - name: Download URL + uses: actions/download-artifact@v1 + with: + name: upload_url + path: ./ + - id: set_upload_url + run: | + upload_url=`cat ./upload_url` + echo ::set-output name=upload_url::$upload_url + + - name: Upload to Release + id: upload_to_release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload_url }} + asset_path: ./${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + asset_name: ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + asset_content_type: application/zip \ No newline at end of file diff --git a/.github/worlflows/build.yml b/.github/worlflows/build.yml new file mode 100644 index 00000000..09bad363 --- /dev/null +++ b/.github/worlflows/build.yml @@ -0,0 +1,309 @@ +name: QMake Build Matrix + +on: [push] + +env: + QT_VERSION: 5.15.2 + QT_CREATOR_VERSION: 4.11.0 + PLUGIN_PRO: doxygen.pro + PLUGIN_NAME: Doxygen + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - { + name: "Windows Latest x64", artifact: "Windows-x64.zip", + os: windows-latest, + environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + } + - { + name: "Windows Latest x86", artifact: "Windows-x86.zip", + os: windows-latest, + environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars32.bat" + } + - { + name: "Linux Latest x64", artifact: "Linux-x64.zip", + os: ubuntu-latest + } + - { + name: "macOS Latest x64", artifact: "macOS-x64.zip", + os: macos-latest + } + + steps: + - uses: actions/checkout@v1 + + - name: Installing system libs + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Linux") + execute_process( + COMMAND sudo apt install libgl1-mesa-dev + ) + endif() + + - name: Download Qt + id: qt + shell: cmake -P {0} + run: | + set(qt_version $ENV{QT_VERSION}) + + string(REPLACE "." "" qt_version_dotless "${qt_version}") + if ("${{ runner.os }}" STREQUAL "Windows") + set(url_os "windows_x86") + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") + set(qt_package_name "qt.qt5.${qt_version_dotless}.win64_msvc2017_64") + set(qt_dir_prefix "${qt_version}/msvc2017_64") + elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + set(qt_package_name "qt.qt5.${qt_version_dotless}.win32_msvc2017") + set(qt_dir_prefix "${qt_version}/msvc2017") + else() + endif() + elseif ("${{ runner.os }}" STREQUAL "Linux") + set(url_os "linux_x64") + set(qt_package_name "qt.qt5.${qt_version_dotless}.gcc_64") + set(qt_dir_prefix "${qt_version}/gcc_64") + elseif ("${{ runner.os }}" STREQUAL "macOS") + set(url_os "mac_x64") + set(qt_package_name "qt.qt5.${qt_version_dotless}.clang_64") + set(qt_dir_prefix "${qt_version}/clang_64") + endif() + + set(qt_base_url "https://download.qt.io/online/qtsdkrepository/${url_os}/desktop/qt5_${qt_version_dotless}") + file(DOWNLOAD "${qt_base_url}/Updates.xml" ./Updates.xml SHOW_PROGRESS) + + file(READ ./Updates.xml updates_xml) + string(REGEX MATCH "${qt_package_name}.*([0-9+-.]+).*qtbase([a-zA-Z0-9_-]+).7z" + updates_xml_output "${updates_xml}") + set(package_version ${CMAKE_MATCH_1}) + set(package_suffix ${CMAKE_MATCH_2}) + string(REPLACE "-debug-symbols" "" package_suffix "${package_suffix}") + + # Workaround for CMake's greedy regex + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + string(REPLACE "X86_64" "X86" package_suffix "${package_suffix}") + endif() + + file(MAKE_DIRECTORY qt5) + + # Save the path for other steps + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qt5/${qt_dir_prefix}" qt_dir) + message("::set-output name=qt_dir::${qt_dir}") + + foreach(package qtbase qtdeclarative qttools qtsvg) + file(DOWNLOAD + "${qt_base_url}/${qt_package_name}/${package_version}${package}${package_suffix}.7z" ./${package}.7z + SHOW_PROGRESS + ) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qt5) + endforeach() + + file(READ "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" qtconfig) + string(REPLACE "Enterprise" "OpenSource" qtconfig "${qtconfig}") + string(REPLACE "licheck.exe" "" qtconfig "${qtconfig}") + string(REPLACE "licheck64" "" qtconfig "${qtconfig}") + string(REPLACE "licheck_mac" "" qtconfig "${qtconfig}") + file(WRITE "qt5/${qt_dir_prefix}/mkspecs/qconfig.pri" "${qtconfig}") + + - name: Download Qt Creator + id: qt_creator + shell: cmake -P {0} + run: | + string(REGEX MATCH "([0-9]+.[0-9]+).[0-9]+" outvar "$ENV{QT_CREATOR_VERSION}") + set(qtc_base_url "https://download.qt.io/official_releases/qtcreator/${CMAKE_MATCH_1}/$ENV{QT_CREATOR_VERSION}") + + if ("${{ runner.os }}" STREQUAL "Windows") + set(qtc_output_directory "qtcreator/lib/qtcreator/plugins") + set(qtc_binary_name "$ENV{PLUGIN_NAME}4.dll") + if ("${{ matrix.config.environment_script }}" MATCHES "vcvars64.bat") + set(qtc_platform "windows_msvc2017_x64") + elseif ("${{ matrix.config.environment_script }}" MATCHES "vcvars32.bat") + set(qtc_platform "windows_msvc2017_x86") + endif() + elseif ("${{ runner.os }}" STREQUAL "Linux") + set(qtc_output_directory "qtcreator/lib/qtcreator/plugins") + set(qtc_binary_name "lib$ENV{PLUGIN_NAME}.so") + set(qtc_platform "linux_gcc_64_rhel72") + elseif ("${{ runner.os }}" STREQUAL "macOS") + set(qtc_output_directory "qtcreator/bin/Qt Creator.app/Contents/PlugIns") + set(qtc_binary_name "lib$ENV{PLUGIN_NAME}.dylib") + set(qtc_platform "mac_x64") + endif() + + # Save the path for other steps + message("::set-output name=qtc_binary_name::${qtc_binary_name}") + message("::set-output name=qtc_output_directory::${qtc_output_directory}") + + file(MAKE_DIRECTORY qtcreator) + + foreach(package qtcreator qtcreator_dev) + file(DOWNLOAD + "${qtc_base_url}/installer_source/${qtc_platform}/${package}.7z" ./${package}.7z SHOW_PROGRESS) + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar xvf ../${package}.7z WORKING_DIRECTORY qtcreator) + endforeach() + + if ("${{ runner.os }}" STREQUAL "macOS") + execute_process( + COMMAND ${CMAKE_COMMAND} -E make_directory qtcreator/bin + COMMAND ${CMAKE_COMMAND} -E create_symlink + "$ENV{GITHUB_WORKSPACE}/qtcreator/Qt Creator.app" + "$ENV{GITHUB_WORKSPACE}/qtcreator/bin/Qt Creator.app" + ) + endif() + + - name: Configure + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") + execute_process( + COMMAND "${{ matrix.config.environment_script }}" && set + OUTPUT_FILE environment_script_output.txt + ) + file(STRINGS environment_script_output.txt output_lines) + foreach(line IN LISTS output_lines) + if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") + set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") + + # Set for other steps + message("::set-env name=${CMAKE_MATCH_1}::${CMAKE_MATCH_2}") + endif() + endforeach() + endif() + + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qtcreator" qtcreator_dir) + + execute_process( + COMMAND ${{ steps.qt.outputs.qt_dir }}/bin/qmake + $ENV{PLUGIN_PRO} + CONFIG+=release + QTC_SOURCE="${qtcreator_dir}" + QTC_BUILD="${qtcreator_dir}" + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + + - name: Build + shell: cmake -P {0} + run: | + if ("${{ runner.os }}" STREQUAL "Windows") + set(ENV{PATH} "${{ steps.qt.outputs.qt_dir }}/bin/;$ENV{PATH}") + else() + set(ENV{PATH} "${{ steps.qt.outputs.qt_dir }}/bin/:$ENV{PATH}") + set(ENV{LD_LIBRARY_PATH} "qtcreator/lib/Qt/lib:$ENV{LD_LIBRARY_PATH}") + endif() + + include(ProcessorCount) + ProcessorCount(N) + + set(make_program make -j ${N}) + if ("${{ runner.os }}" STREQUAL "Windows") + set(make_program "qtcreator/bin/jom") + endif() + + execute_process( + COMMAND ${make_program} + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/$ENV{PLUGIN_NAME}-$ENV{QT_CREATOR_VERSION}-${{ matrix.config.artifact }}" artifact) + + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvf ${artifact} --format=zip "${{ steps.qt_creator.outputs.qtc_binary_name }}" + WORKING_DIRECTORY "${{ steps.qt_creator.outputs.qtc_output_directory }}" + ) + + - uses: actions/upload-artifact@v1 + id: upload_artifact + with: + path: ./${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + name: ${{ env.PLUGIN_NAME}}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + + release: + if: contains(github.ref, 'tags/v') + runs-on: ubuntu-latest + needs: build + + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Store Release url + run: | + echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url + + - uses: actions/upload-artifact@v1 + with: + path: ./upload_url + name: upload_url + + publish: + if: contains(github.ref, 'tags/v') + + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - { + name: "Windows Latest x64", artifact: "Windows-x64.zip", + os: ubuntu-latest + } + - { + name: "Windows Latest x86", artifact: "Windows-x86.zip", + os: ubuntu-latest + } + - { + name: "Linux Latest x64", artifact: "Linux-x64.zip", + os: ubuntu-latest + } + - { + name: "macOS Latest x64", artifact: "macOS-x64.zip", + os: macos-latest + } + needs: release + + steps: + - name: Download artifact + uses: actions/download-artifact@v1 + with: + name: ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + path: ./ + + - name: Download URL + uses: actions/download-artifact@v1 + with: + name: upload_url + path: ./ + - id: set_upload_url + run: | + upload_url=`cat ./upload_url` + echo ::set-output name=upload_url::$upload_url + + - name: Upload to Release + id: upload_to_release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload_url }} + asset_path: ./${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + asset_name: ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }} + asset_content_type: application/zip \ No newline at end of file diff --git a/native/src/ReachVariantTool/help/resources/main.css b/native/src/ReachVariantTool/help/resources/main.css index 3028c65c..7977383d 100644 --- a/native/src/ReachVariantTool/help/resources/main.css +++ b/native/src/ReachVariantTool/help/resources/main.css @@ -1,101 +1,361 @@ -html{ - --sidebar-back: #EEE; - --line-height: 1.215em; /*take the firefox default for Calibri and make it explicit, so we can size/position other things relative to it*/ +html { + --sidebar-back: #EEE; + --line-height: 1.215em; /*take the firefox default for Calibri and make it explicit, so we can size/position other things relative to it*/ +} + +* { + line-height: var(--line-height) } -*{line-height:var(--line-height)} /* core layout: */ -html{background:#888;margin:0;padding:0} -body{background:var(--sidebar-back);min-height:100vh;display:flex;flex-flow:row nowrap;max-width:1600px;margin:0 auto;padding:0} - body>*{box-sizing:border-box;height:100vh;overflow-y:auto} - #sidebar{width:25%;min-width:18em;padding:.5rem 1rem;font-size:.875rem;flex:0 0 auto} - #sidebar ul{margin:0;padding:0 0 0 1.5em} - #sidebar li{list-style:none;position:relative} - #sidebar li a{display:block;background:#FFF;padding:.25em .5em;text-decoration:none;border-radius:.2rem} - #sidebar li a{text-overflow:ellipsis;overflow-x:hidden} - #sidebar li a{margin:4px 0} /*spacing*/ - #sidebar li a.you-are-here{font-weight:bold} - #sidebar li.collapsed ul{display:none} - #sidebar>ul{list-style:none;margin:0;padding:0} - #sidebar>ul>li{list-style:none} - #sidebar .toggle{all:unset;position:absolute;right:100%;top:0;text-align:center;width:1.5ch;height:var(--line-height);padding:.25em 0;background:#CCC;color:#000;border-radius:.2rem 0 0 .2rem;cursor:default} - #sidebar .toggle{margin:0} /* Edge doesn't understand "all:unset" */ - #sidebar .toggle::before{content:"-";cursor:default} - #sidebar li.collapsed>.toggle::before{content:"+"} - #sidebar .toggle+a{border-radius:0 .2rem .2rem 0} - #sidebar ul hr{border:0;border-top:1px solid #BBB} - main{background:#FFF;padding:1rem;flex:1 1 auto} +html { + background: #888; + margin: 0; + padding: 0 +} + +body { + background: var(--sidebar-back); + min-height: 100vh; + display: flex; + flex-flow: row nowrap; + max-width: 1600px; + margin: 0 auto; + padding: 0 +} + + body > * { + box-sizing: border-box; + height: 100vh; + overflow-y: auto + } + +#sidebar { + width: 25%; + min-width: 18em; + padding: .5rem 1rem; + font-size: .875rem; + flex: 0 0 auto +} + + #sidebar ul { + margin: 0; + padding: 0 0 0 1.5em + } + + #sidebar li { + list-style: none; + position: relative + } + + #sidebar li a { + display: block; + background: #FFF; + padding: .25em .5em; + text-decoration: none; + border-radius: .2rem + } + + #sidebar li a { + text-overflow: ellipsis; + overflow-x: hidden + } + + #sidebar li a { + margin: 4px 0 + } + /*spacing*/ + #sidebar li a.you-are-here { + font-weight: bold + } + + #sidebar li.collapsed ul { + display: none + } + + #sidebar > ul { + list-style: none; + margin: 0; + padding: 0 + } + + #sidebar > ul > li { + list-style: none + } + + #sidebar .toggle { + all: unset; + position: absolute; + right: 100%; + top: 0; + text-align: center; + width: 1.5ch; + height: var(--line-height); + padding: .25em 0; + background: #CCC; + color: #000; + border-radius: .2rem 0 0 .2rem; + cursor: default + } + + #sidebar .toggle { + margin: 0 + } + /* Edge doesn't understand "all:unset" */ + #sidebar .toggle::before { + content: "-"; + cursor: default + } + + #sidebar li.collapsed > .toggle::before { + content: "+" + } + + #sidebar .toggle + a { + border-radius: 0 .2rem .2rem 0 + } + + #sidebar ul hr { + border: 0; + border-top: 1px solid #BBB + } + +main { + background: #FFF; + padding: 1rem; + flex: 1 1 auto +} /* Firefox bug: #sidebar does not scroll to the bottom padding when overflow-y:auto kicks in i.e. there effectively is no bottom padding */ -#sidebar{padding-bottom:0} /* remove the padding-bottom so we don't double-pad for other browsers */ - #sidebar::after{height:.5rem;content:" ";display:block} /* use a pseudo-element instead of padding */ -main{padding-bottom:0} /* this bug affects main, too */ - main::after{height:.5rem;content:" ";display:block} - -main header{margin-bottom:1rem} - main header h1 {margin-bottom:0} - header .a-k-a, - header .type{display:block;color:#666;font-size:1.1rem;font-weight:normal} - -#toc{max-width:20rem;list-style:none;margin:1em 0;padding:.25rem .5rem;border:1px solid #AAA;border-radius:3px;background:#FCFCFC} - #toc::before{display:block;content:"Contents";font-weight:bold;text-align:center} - #toc ul{list-style:none;margin:0;padding:0 0 0 1rem} - #toc li{margin:0;padding:.1em 0} - #toc li+li{border-top:1px solid #E0E0E0} - -p, h1, h2, h3, h4, h5, h6{margin:1rem 0} -/* manage initial/final margins: */ -h1:first-child, -h2:first-child, -h3:first-child, -h4:first-child, -h5:first-child, -h6:first-child, -p:first-child{margin-top:0} -h1:last-child, -h2:last-child, -h3:last-child, -h4:last-child, -h5:last-child, -h6:last-child, -p:last-child{margin-bottom:0} - -.header-permalink{margin-left:1em;font-size:1rem;font-weight:normal} - .header-permalink::before{content:"🔗"} -.header-permalink{display:none} -*:hover>.header-permalink{display:inline} +#sidebar { + padding-bottom: 0 +} + /* remove the padding-bottom so we don't double-pad for other browsers */ + #sidebar::after { + height: .5rem; + content: " "; + display: block + } +/* use a pseudo-element instead of padding */ +main { + padding-bottom: 0 +} + /* this bug affects main, too */ + main::after { + height: .5rem; + content: " "; + display: block + } + + main header { + margin-bottom: 1rem + } + + main header h1 { + margin-bottom: 0 + } + +header .a-k-a, +header .type { + display: block; + color: #666; + font-size: 1.1rem; + font-weight: normal +} + +#toc { + max-width: 20rem; + list-style: none; + margin: 1em 0; + padding: .25rem .5rem; + border: 1px solid #AAA; + border-radius: 3px; + background: #FCFCFC +} + + #toc::before { + display: block; + content: "Contents"; + font-weight: bold; + text-align: center + } + + #toc ul { + list-style: none; + margin: 0; + padding: 0 0 0 1rem + } + + #toc li { + margin: 0; + padding: .1em 0 + } + + #toc li + li { + border-top: 1px solid #E0E0E0 + } + +p, h1, h2, h3, h4, h5, h6 { + margin: 1rem 0 +} + /* manage initial/final margins: */ + h1:first-child, + h2:first-child, + h3:first-child, + h4:first-child, + h5:first-child, + h6:first-child, + p:first-child { + margin-top: 0 + } + + h1:last-child, + h2:last-child, + h3:last-child, + h4:last-child, + h5:last-child, + h6:last-child, + p:last-child { + margin-bottom: 0 + } + +.header-permalink { + margin-left: 1em; + font-size: 1rem; + font-weight: normal +} + + .header-permalink::before { + content: "🔗" + } + +.header-permalink { + display: none +} + +*:hover > .header-permalink { + display: inline +} /* yellow fade when jumping to a header (TODO: wrap sections in
so we can fade the whole section and not just the header) */ @keyframes jump-to-section { - 0% { - background:rgba(255, 255, 128, 0.5); - box-shadow:0 0 6px 6px rgba(255, 255, 128, 0.5); - } - 100% { background:transparent } -} -a:target{animation:jump-to-section 3s ease-in 1} - -h2{border-bottom:1px solid #DDD} - -body{font-family:Calibri,Verdana,sans-serif} -dl{} - dt{font-weight:bold} - dd{} - dd+dt{margin-top:1em} - -main ul>li+li{margin-top:.5em} - -code{background:#EEE} -pre{padding:.5em;background:#F4F4F4;border:1px solid #DDD;overflow-x:auto} - pre .comment{color:#292;font-style:italic} - pre .string{color:#777} - pre .keyword{color:#00F;font-weight:bold} - pre .subkeyword{color:#07B;font-weight:bold} - -a{text-decoration:none} -a:link{color:#03E} -a:visited{color:#938} -a:link:hover{text-decoration:underline} -#sidebar a:link:hover{color:#36F;text-decoration:none} -#sidebar a:visited:hover{color:#B5A} \ No newline at end of file + 0% { + background: rgba(255, 255, 128, 0.5); + box-shadow: 0 0 6px 6px rgba(255, 255, 128, 0.5); + } + + 100% { + background: transparent + } +} + +a:target { + animation: jump-to-section 3s ease-in 1 +} + +h2 { + border-bottom: 1px solid #DDD +} + +body { + font-family: Calibri,Verdana,sans-serif +} + +dl { +} + +dt { + font-weight: bold +} + +dd { +} + + dd + dt { + margin-top: 1em + } + +main ul > li + li { + margin-top: .5em +} + +code { + background: #EEE +} + +pre { + padding: .5em; + background: #F4F4F4; + border: 1px solid #DDD; + overflow-x: auto +} + + pre .comment { + color: #292; + font-style: italic + } + + pre .string { + color: #777 + } + + pre .keyword { + color: #00F; + font-weight: bold + } + + pre .subkeyword { + color: #07B; + font-weight: bold + } + + pre .iterator { + color: #DC143C; + font-weight: bold + } + + pre .function { + color: #2e8c35; + font-weight: bold; + } + + pre .variable { + color: #ad1c73; + font-weight: bold; + } + + pre .operator { + color: #29a6a2; + font-weight: bold; + } + + pre .namespace { + color: #dbb02e; + font-weight: bold; + } + +a { + text-decoration: none +} + + a:link { + color: #03E + } + + a:visited { + color: #938 + } + + a:link:hover { + text-decoration: underline + } + +#sidebar a:link:hover { + color: #36F; + text-decoration: none +} + +#sidebar a:visited:hover { + color: #B5A +} diff --git a/native/src/ReachVariantTool/help/script/api/object/actions/face_toward.html b/native/src/ReachVariantTool/help/script/api/object/actions/face_toward.html index 92862e50..066384b0 100644 --- a/native/src/ReachVariantTool/help/script/api/object/actions/face_toward.html +++ b/native/src/ReachVariantTool/help/script/api/object/actions/face_toward.html @@ -1,160 +1,234 @@ - - - object.face_toward | ReachVariantTool Documentation - - - - - - - -
-

object.face_toward

+ +

See also

+ -

- This function can be used to make one object face toward another. It only - affects the object's heading (yaw), not its pitch or roll rotations. -

- -

Arguments

-
-
other
-

- The object whose rotation should be copied. -

-
x
-

- The X-coordinate of an offset-position. The object will rotate to face - other's position plus the offset position. Allowed values are - integer constants between -128 and 127, inclusive, where 10 is equal to - one Forge unit. -

-
y
-

- The Y-coordinate of an offset-position. The object will rotate to face - other's position plus the offset position. Allowed values are - integer constants between -128 and 127, inclusive, where 10 is equal to - one Forge unit. -

-
z
-

- The Z-coordinate of an offset-position. The object will rotate to face - other's position plus the offset position. Allowed values are - integer constants between -128 and 127, inclusive, where 10 is equal to - one Forge unit. -

-
-

Example

-
-global.object[0].copy_rotation_from(global.object[1], true)
-

Notes

-
    -
  • - If you face an object toward itself, you can use the position offset to rotate it. -

  • -

See also

- +
+ + + - - - - \ No newline at end of file