This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
Release #73
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: Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
pack: | |
name: Pack source tarball | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Create source tarball | |
run: | | |
SOURCE_NAME=${GITHUB_REPOSITORY##*/}-${GITHUB_REF##*/} | |
git ls-files --recurse-submodules | \ | |
tar --exclude-vcs --transform "s|^|$SOURCE_NAME/|S" -ca -T - -f ../$SOURCE_NAME-source.tar.gz | |
- name: Upload source tarball | |
uses: AButler/upload-release-assets@v2.0 | |
with: | |
files: '../*.tar.gz' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
name: Release | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019] | |
arch: [amd64, aarch64, armv7] | |
include: | |
- os: ubuntu-20.04 | |
extra-cmake-arguments: >- | |
-D CPACK_GENERATOR="DEB;RPM;External" | |
- 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 WITH_PORTABLE_MODE=ON | |
-D CPACK_GENERATOR="NSIS;7Z" | |
-D X_VCPKG_APPLOCAL_DEPS_INSTALL=ON | |
exclude: | |
- os: windows-2019 | |
arch: aarch64 | |
- os: windows-2019 | |
arch: armv7 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install apt packages | |
if: runner.os == 'Linux' && matrix.arch == 'amd64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install extra-cmake-modules libqt5x11extras5-dev qttools5-dev qtmultimedia5-dev libkf5wayland-dev libtesseract-dev rpm qt5-default qtgstreamer-plugins-qt5 gstreamer1.0-plugins-good gstreamer1.0-alsa gstreamer1.0-pulseaudio libqt5multimedia5-plugins qt5-style-plugins ninja-build | |
sudo apt-get remove qt5-gtk-platformtheme # Do not use libqgtk3.so because of https://bugreports.qt.io/browse/QTBUG-72506 | |
- name: Install linuxdeploy | |
if: matrix.os == 'ubuntu-20.04' | |
uses: miurahr/install-linuxdeploy-action@v1 | |
with: | |
plugins: qt gstreamer | |
# 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.4 | |
if: runner.os == 'Windows' | |
with: | |
vcpkgJsonGlob: vcpkg.json | |
- name: Setup MSVC | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Build | |
if: matrix.arch == 'amd64' | |
run: | | |
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=Release ${{ matrix.extra-cmake-arguments }} | |
cmake --build build --target package --parallel 2 --config Release | |
- name: Build in Ubuntu 20.04 Docker image | |
uses: uraimo/run-on-arch-action@v2.5.0 | |
if: matrix.os == 'ubuntu-20.04' && matrix.arch != 'amd64' | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ubuntu20.04 | |
githubToken: ${{ github.token }} | |
dockerRunArgs: --volume "${PWD}:/repo" | |
install: | | |
apt-get update -y | |
apt-get install -y libxcb1-dev extra-cmake-modules libqt5x11extras5-dev qttools5-dev qtmultimedia5-dev libkf5wayland-dev libtesseract-dev g++ git rpm libssl-dev wget ninja-build | |
# Install fresh CMake due to problems with QEMU: https://gitlab.kitware.com/cmake/cmake/-/issues/20568 | |
# https://apt.kitware.com currently have an issue with unresolved dependency on arm, build manually | |
CMAKE_VERSION=3.21.1 | |
wget --no-check-certificate https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION.tar.gz | |
tar -zxvf cmake-$CMAKE_VERSION.tar.gz | |
cd cmake-$CMAKE_VERSION | |
./bootstrap --generator=Ninja | |
ninja install -j 2 | |
run: | | |
cmake -S /repo -B /repo/build -G Ninja -D CMAKE_BUILD_TYPE=Release ${{ matrix.extra-cmake-arguments }} | |
cmake --build /repo/build --target package --parallel 2 | |
- name: Upload | |
uses: AButler/upload-release-assets@v2.0 | |
with: | |
files: build/{crow-translate*.exe,*.AppImage,*.AppImage.zsync,*.deb,*.rpm,*.7z} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |