This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
Install icoutils on Windows even on main workflow #1116
Workflow file for this run
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: Main | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
- '.github/workflows/release.yml' | |
- '.gitignore' | |
- 'crowdin.yml' | |
- 'data/translations/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '.github/workflows/release.yml' | |
- '.gitignore' | |
- 'crowdin.yml' | |
- 'data/translations/**' | |
jobs: | |
validate-metainfo: | |
name: Validate metainfo | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Install AppStream metadata utility | |
run: | | |
sudo apt-get update | |
sudo apt-get install appstream-util | |
- name: Validate metainfo | |
run: appstream-util validate-relax data/io.crow_translate.CrowTranslate.metainfo.xml | |
format: | |
name: Format | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Check formatting | |
uses: DoozyX/clang-format-lint-action@v0.15 | |
with: | |
clangFormatVersion: 12 | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019] | |
include: | |
- os: ubuntu-20.04 | |
extra-cmake-arguments: >- | |
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" | |
- os: windows-2019 | |
extra-cmake-arguments: >- | |
-D CMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake | |
-D VCPKG_TARGET_TRIPLET=x64-windows | |
-D VCPKG_INSTALL_OPTIONS=--clean-after-build | |
-D X_VCPKG_APPLOCAL_DEPS_INSTALL=ON | |
-D CMAKE_CXX_FLAGS="/experimental:external /external:anglebrackets /external:W0 /W4 /wd4530 /WX" | |
-D CMAKE_CXX_CLANG_TIDY='clang-tidy;--warnings-as-errors=*' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install apt packages | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install extra-cmake-modules libqt5x11extras5-dev qttools5-dev qtmultimedia5-dev libkf5wayland-dev libtesseract-dev ninja-build | |
# To set the application icon | |
- name: Install icoutils | |
if: runner.os == 'Windows' | |
run: | | |
$version = "0.32.3" | |
Invoke-WebRequest -Uri "https://sourceforge.net/projects/unix-utils/files/icoutils/icoutils-$version-x86_64.zip" -OutFile icoutils.zip -UserAgent "NativeHost" -SkipCertificateCheck | |
7z x icoutils.zip | |
echo "${{ github.workspace }}/icoutils-$version-x86_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Install vcpkg | |
uses: lukka/run-vcpkg@v11.5 | |
if: runner.os == 'Windows' | |
with: | |
vcpkgJsonGlob: vcpkg.json | |
- name: Setup MSVC | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Build | |
run: | | |
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D WITH_PORTABLE_MODE=ON -DCMAKE_INSTALL_PREFIX=install ${{ matrix.extra-cmake-arguments }} | |
cmake --build build --parallel 2 --target install | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crow-translate-${{ matrix.os }} | |
path: install/** |