forked from GSam/Capture2Text
-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (83 loc) · 3.66 KB
/
ubuntu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Ubuntu
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
qt_ver: [5.15.2]
qt_arch: [gcc_64]
steps:
- name: Install Qt
uses: jurplel/[email protected]
with:
version: ${{ matrix.qt_ver }}
cached: 'false'
modules: qttexttospeech
- name: ubuntu install thirdparty dependencies
run: |
sudo apt-get install git pkg-config build-essential qt5-qmake
sudo apt-get install libtesseract-dev qtbase5-dev qt5-default libleptonica-dev libqt5texttospeech5-dev qtspeech5-speechd-plugin libspeechd-dev
sudo ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: build Capture2Text
run: |
qmake CONFIG+=release PREFIX=/usr
make INSTALL_ROOT=appdir -j`nproc` install; find appdir/
wget "https://github.com/GSam/Capture2Text/releases/download/Prototype/English.zip"
unzip -o "English.zip" -d "appdir/usr/bin/tessdata"
cp Capture2Text.png appdir/
- name: Build AppImage
run: |
wget -c -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage
wget -c -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod a+x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appdir appdir --output appimage --plugin qt -i Capture2Text.png -d Capture2Text.desktop
- uses: actions/upload-artifact@v2
with:
name: AppImage
path: './*.AppImage*'
- name: Set outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=release_date::$(date +'%Y%m%d')"
echo "::set-output name=release_time::$(date +'%H%M%S')"
echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')"
echo "::set-output name=appname::$(ls *.AppImage*)"
- name: uploadRelease
# if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.vars.outputs.appname }}
asset_name: ${{ steps.vars.outputs.appname }}
tag: prerelease-${{steps.vars.outputs.release_date}}
overwrite: true
release_name: Ubuntu-Windows-${{ github.ref_name }}.${{ steps.vars.outputs.sha_short }} built on ${{steps.vars.outputs.release_date}} ${{steps.vars.outputs.release_time_clock}}
prerelease: true
body: |
release on date: ${{steps.vars.outputs.release_date}} time: ${{steps.vars.outputs.release_time_clock}}
branch: ${{ github.ref_name }}
commit: ${{ steps.vars.outputs.sha_short }}
Qt version: ${{ matrix.qt_ver }} ${{ matrix.qt_arch }}
Windows built with: MSVC-64 Visual studio 2019
AppImage built with: Ubuntu-20.04 ,latest gcc ,built with english ocr .if you want other `Language` ,build by yourself following steps.
This is a prerelease version ,auto build by github action. use on your on risk:-)