diff --git a/.github/workflows/PR-check-cmake.yml b/.github/workflows/PR-check-cmake.yml index 0302fef2..131a6b81 100644 --- a/.github/workflows/PR-check-cmake.yml +++ b/.github/workflows/PR-check-cmake.yml @@ -11,132 +11,115 @@ on: - experimental - staged paths-ignore: - - 'docs/**' - # - ".github/**" - - "howto/**" + - "docs/**" - "*.md" - "locale/**" + - "website/**" jobs: - job1: + job_ubuntu_build_check: name: ubuntu Build and analyze - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v3 - with: - python-version: '3.9' - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - # Qt6.4 for testing ubuntu LTS - version: 6.4.3 - arch: gcc_64 - modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtspeech - setup-python: 'false' - - - name: ubuntu install thirdparty dependencies + runs-on: ubuntu-24.04 + steps: + - name: Install dependencies run: | - sudo apt-get install git pkg-config build-essential - sudo apt-get install libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev - sudo apt-get install libxtst-dev liblzo2-dev libbz2-dev - sudo apt-get install libavutil-dev libavformat-dev libeb16-dev - sudo apt-get install doxygen libzstd-dev libxkbcommon-dev libgstreamer-plugins-base1.0-0 libgstreamer-gl1.0-0 - sudo ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld - sudo apt install libxapian-dev - - #build opencc - git clone https://github.com/BYVoid/OpenCC - cd OpenCC/ - make PREFIX=/usr -j$(nproc) - sudo make install - cd .. - sudo apt-get install libzim-dev + sudo apt-get install build-essential ninja-build \ + libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \ + libxtst-dev liblzo2-dev libbz2-dev \ + libavutil-dev libavformat-dev libeb16-dev \ + libzstd-dev libxkbcommon-dev \ + libxapian-dev libzim-dev libopencc-dev \ + qt6-5compat-dev \ + qt6-base-dev \ + qt6-multimedia-dev \ + qt6-speech-dev \ + qt6-svg-dev \ + qt6-tools-dev \ + qt6-tools-dev-tools \ + qt6-webchannel-dev \ + qt6-webengine-dev - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: false - - - name: Run build-wrapper + - name: Run build run: | - cmake . - cmake --build . + mkdir build_dir + cmake -S . \ + -B ./build_dir \ + -G Ninja + cmake --build ./build_dir + job_macos_build_check: + name: macos Build and analyze + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + submodules: false + - name: Install dependencies + run: | + brew install \ + ninja \ + opencc \ + ffmpeg \ + libao \ + libiconv \ + bzip2 \ + lzip \ + libvorbis \ + hunspell \ + xapian \ + libzim \ + qt - job2: + wget ftp://ftp.sra.co.jp/pub/misc/eb/eb-4.4.3.tar.bz2 + tar xvjf eb-4.4.3.tar.bz2 + cd eb-4.4.3 && ./configure && make -j 8 && sudo make install && cd .. + + - name: Run build + run: | + mkdir build_dir + cmake -S . \ + -B ./build_dir \ + -G Ninja + cmake --build ./build_dir + + job_window_build_check: name: windows Build and analyze runs-on: windows-latest - steps: - - uses: actions/setup-python@v3 - with: - python-version: '3.9' + steps: - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: - version: 6.5.1 + version: 6.7.2 arch: win64_msvc2019_64 - - #serialport linuxdeploy need serialport to work. - modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtspeech qtserialport + modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtspeech setup-python: 'false' - - uses: ilammy/msvc-dev-cmd@v1 - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: true - - - name: Run build-wrapper + - name: Setup vcpkg github caches variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Run build + id: build + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | - cmake -S . -DWITH_FFMPEG_PLAYER=OFF - cmake --build . --config Release - job3: - name: macos Build and analyze - runs-on: macos-12 - steps: - - uses: actions/setup-python@v3 - with: - python-version: '3.9' - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - version: 6.5.1 - arch: clang_64 + # Launch-VsDevShell also provides Ninja + & 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1' ` + -SkipAutomaticLocation -Arch amd64 -HostArch amd64 - #serialport linuxdeploy need serialport to work. - modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtspeech qtserialport - setup-python: 'false' - - uses: ilammy/msvc-dev-cmd@v1 - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - submodules: false - - name: install dependencies - run: | - brew install pcre2 harfbuzz freetype - brew install cmake ninja python - brew install automake - brew install autoconf - brew install libtool - brew install opencc - - brew install speex - brew tap homebrew-ffmpeg/ffmpeg - brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-speex - brew install libao - brew install libiconv - brew install lzo bzip2 - brew install libogg - brew install zstd lzip - brew install libvorbis --force - brew install hunspell - wget ftp://ftp.sra.co.jp/pub/misc/eb/eb-4.4.3.tar.bz2 - tar xvjf eb-4.4.3.tar.bz2 - cd eb-4.4.3 && ./configure && make -j 8 && sudo make install && cd .. - #brew install qt # or use official offline installer - brew install xz lzo - brew install pkg-config - brew install xapian - brew install libzim - brew install icu4c - - name: Run build-wrapper - run: | - cmake . - cmake --build . - \ No newline at end of file + New-Item -Path './build_dir' -ItemType Directory + cmake -S . -B "./build_dir" ` + -G Ninja ` + -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ` + -DWITH_FFMPEG_PLAYER=OFF ` + -DUSE_VCPKG=ON ` + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" ` + -DWITH_VCPKG_BREAKPAD=ON + cmake --build "./build_dir" diff --git a/.github/workflows/release-macos-homebrew.yml b/.github/workflows/release-macos-homebrew.yml index 8fbd5586..0fc80c55 100644 --- a/.github/workflows/release-macos-homebrew.yml +++ b/.github/workflows/release-macos-homebrew.yml @@ -157,14 +157,14 @@ jobs: file_glob: true tag: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.sha_short }} overwrite: true - release_name: GoldenDict-ng-v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} + release_name: v${{env.version}}-${{env.version-suffix}}.${{ steps.vars.outputs.release_hm }}.${{ steps.vars.outputs.sha_short }} prerelease: ${{env.prerelease}} body: | [Install instructions for Windows, macOS and Linux](https://xiaoyifang.github.io/goldendict-ng/install/). - Filaname pattern: GoldenDict-[version]-[Qt version]-[system name]-... + Filename pattern: GoldenDict-ng-[version]-[Qt version]-[system name]-... - For Linux, released vesion is on Flathub -> [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). + For Linux, the released version is on Flathub → [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). Based on branch: ${{github.ref_name}} diff --git a/.github/workflows/release-windows-vcpkg-cmake.yml b/.github/workflows/release-windows-vcpkg-cmake.yml index dfc65bc7..00b986ef 100644 --- a/.github/workflows/release-windows-vcpkg-cmake.yml +++ b/.github/workflows/release-windows-vcpkg-cmake.yml @@ -1,4 +1,4 @@ -name: Release Windows Vcpkg CMake +name: Release Windows CMake concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -147,9 +147,9 @@ jobs: $changeNotes = " [Install instructions for Windows, macOS and Linux](https://xiaoyifang.github.io/goldendict-ng/install/). - Filaname pattern: GoldenDict-[version]-[Qt version]-[system name]-... + Filename pattern: GoldenDict-ng-[version]-[Qt version]-[system name]-... - For Linux, released vesion is on Flathub -> [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). + For Linux, the released version is on Flathub → [io.github.xiaoyifang.goldendict_ng](https://flathub.org/apps/io.github.xiaoyifang.goldendict_ng). Based on branch: ${{github.ref_name}} @@ -169,7 +169,7 @@ jobs: # file name after # is display label - $namePrefix="GoldenDict-${{env.version}}-Qt${{matrix.qt_ver}}" + $namePrefix="GoldenDict-ng-${{env.version}}-Qt${{matrix.qt_ver}}" cd './build_dir' gh release upload "${tagName}" "${namePrefix}.7z#${namePrefix}-Windows.7z" --clobber diff --git a/.github/workflows/PR-check-windows.yml b/.github/workflows/unused-PR-check-windows.yml similarity index 85% rename from .github/workflows/PR-check-windows.yml rename to .github/workflows/unused-PR-check-windows.yml index 6764d005..986ed32f 100644 --- a/.github/workflows/PR-check-windows.yml +++ b/.github/workflows/unused-PR-check-windows.yml @@ -1,4 +1,4 @@ -name: Windows-PR-check +name: Windows-qmake-PR-check concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -6,19 +6,19 @@ on: workflow_dispatch: - pull_request: - branches: - - dev - - master - - experimental - - staged - paths-ignore: - - 'docs/**' - # - ".github/**" - - "howto/**" - - "*.md" - - "locale/**" - - "website/**" + # pull_request: + # branches: + # - dev + # - master + # - experimental + # - staged + # paths-ignore: + # - 'docs/**' + # # - ".github/**" + # - "howto/**" + # - "*.md" + # - "locale/**" + # - "website/**" jobs: build: diff --git a/.github/workflows/release-windows.yml b/.github/workflows/unused-release-windows.yml similarity index 100% rename from .github/workflows/release-windows.yml rename to .github/workflows/unused-release-windows.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index a7e91822..49a671aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,7 +270,7 @@ if (APPLE) --volicon ${CMAKE_SOURCE_DIR}/icons/macicon.icns \ --icon \"${App_Name}\" 100 100 --app-drop-link 300 100 \ - \"GoldenDict-${CMAKE_PROJECT_VERSION}-Qt${Qt6_VERSION}-macOS-${CMAKE_SYSTEM_PROCESSOR}.dmg\" \ + \"GoldenDict-ng-${CMAKE_PROJECT_VERSION}-Qt${Qt6_VERSION}-macOS-${CMAKE_SYSTEM_PROCESSOR}.dmg\" \ \"${Assembling_Dir}\")" ) else () @@ -353,7 +353,7 @@ if (WIN32) PATTERN "*.ilk" EXCLUDE) - set(CPACK_PACKAGE_FILE_NAME "GoldenDict-${PROJECT_VERSION}-Qt${Qt6Widgets_VERSION}") + set(CPACK_PACKAGE_FILE_NAME "GoldenDict-ng-${PROJECT_VERSION}-Qt${Qt6Widgets_VERSION}") set(CPACK_GENERATOR "7Z;NSIS64") # override the default install path, which is $PROGRAMFILES64\${project-name} ${project-version} in NSIS