Added windows ci.
This commit is contained in:
commit
b022dd18f4
45
.appveyor.yml
Normal file
45
.appveyor.yml
Normal file
@ -0,0 +1,45 @@
|
||||
image: Visual Studio 2015
|
||||
|
||||
environment:
|
||||
ARCH: x86
|
||||
sf_secret:
|
||||
secure: 8QOHSPQLI/lmjgOhyGOsMA5MxOdeSnlFWWKjntqEfBMfW/XCuiEk5tHNjZiiAw8N
|
||||
sf_api:
|
||||
secure: S4qrbAdLq3Hw5yozC7XAavTGzpPPh8MleX+r8kaueBtPZUeJGt+8EoqaPw0P1PzV
|
||||
|
||||
clone_depth: 1
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
init:
|
||||
- if /i %APPVEYOR_REPO_TAG% == true set WITH_TESSDATA=1
|
||||
|
||||
cache:
|
||||
- installed -> scripts\win\prepare.bat
|
||||
|
||||
install:
|
||||
- cinst winscp
|
||||
- nuget install secure-file -ExcludeVersion
|
||||
- call "scripts\win\prepare.bat"
|
||||
|
||||
build_script:
|
||||
- call "scripts\win\build.bat"
|
||||
|
||||
artifacts:
|
||||
- path: 'screen-translator-*.exe'
|
||||
name: installer
|
||||
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
description: "Version $(APPVEYOR_REPO_TAG_NAME)"
|
||||
auth_token:
|
||||
secure: NnyUV44yNAx8ea1L46dVhE4kQxUGd5M1O+yVk+9ncsNHWtw/9JoCnDqNybnxTccP
|
||||
artifact: installer
|
||||
force_update: true
|
||||
on:
|
||||
appveyor_repo_tag: true
|
||||
|
||||
after_deploy:
|
||||
- secure-file\tools\secure-file -decrypt scripts\win\sf_key.av -secret %sf_secret% -out scripts\win\sf_key
|
||||
- call "scripts\win\deploy_sf.bat"
|
@ -1,4 +1,6 @@
|
||||
[](https://travis-ci.org/OneMoreGres/ScreenTranslator.svg)
|
||||
[](https://img.shields.io/appveyor/ci/OneMoreGres/ScreenTranslator.svg)
|
||||
|
||||
|
||||
Screen Translator
|
||||
=================
|
||||
|
59
scripts/win/build.bat
Normal file
59
scripts/win/build.bat
Normal file
@ -0,0 +1,59 @@
|
||||
@echo off
|
||||
|
||||
set SELF_PATH=%~dp0
|
||||
call %SELF_PATH%\env.bat
|
||||
|
||||
|
||||
::build
|
||||
rmdir /q /s build
|
||||
set ROOT=%SELF_PATH%\..\..
|
||||
lrelease %ROOT%\ScreenTranslator.pro
|
||||
mkdir build
|
||||
cd build
|
||||
qmake INCLUDEPATH+=%cd%\..\installed\include LIBS+=-L%cd%\..\installed\bin LIBS+=-L%cd%\..\installed\lib %ROOT%
|
||||
nmake
|
||||
cd ..
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
|
||||
::pack
|
||||
rmdir /q /s iss
|
||||
mkdir iss
|
||||
copy /Y %ROOT%\distr\iss\* iss
|
||||
copy /Y %ROOT%\distr\Changelog_en.txt iss\
|
||||
copy /Y %ROOT%\distr\Changelog_ru.txt iss\
|
||||
copy /Y %ROOT%\LICENSE.md iss\LICENSE_en.md
|
||||
copy /Y %ROOT%\images\icon.ico iss\icon.ico
|
||||
|
||||
mkdir iss\content
|
||||
copy /Y build\release\ScreenTranslator.exe iss\content\ScreenTranslator.exe
|
||||
copy /Y installed\bin\*.dll iss\content
|
||||
mkdir iss\content\translations
|
||||
copy /Y %ROOT%\translations\*.qm iss\content\translations
|
||||
mkdir iss\content\translators
|
||||
copy /Y %ROOT%\translators\* iss\content\translators
|
||||
|
||||
windeployqt --release iss\content\ScreenTranslator.exe
|
||||
|
||||
for /f "delims=" %%i in ('findstr versionString %ROOT%\version.json') do set VERSION_LINE=%%i
|
||||
set UNQUOTED=%VERSION_LINE:"='%
|
||||
for /f "tokens=4 delims='" %%i in ("%UNQUOTED%") do set VERSION=%%i
|
||||
echo #define MyAppVersion "%VERSION%" > iss\defines.iss
|
||||
|
||||
|
||||
|
||||
cd iss
|
||||
iscc.exe InnoSetup.iss
|
||||
cd ..
|
||||
|
||||
|
||||
if "%WITH_TESSDATA%" == "" goto end
|
||||
|
||||
mkdir iss\tessdata
|
||||
copy /Y download\tessdata\* iss\tessdata
|
||||
|
||||
cd iss
|
||||
iscc.exe InnoSetupWithTessdata.iss
|
||||
cd ..
|
||||
|
||||
:end
|
26
scripts/win/deploy_sf.bat
Normal file
26
scripts/win/deploy_sf.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
|
||||
set PATH=c:\Program Files (x86)\WinSCP\;%PATH%
|
||||
|
||||
set SELF_PATH=%~dp0
|
||||
set ROOT=%SELF_PATH%\..\..
|
||||
|
||||
|
||||
for /f "delims=" %%i in ('findstr versionString %ROOT%\version.json') do set VERSION_LINE=%%i
|
||||
set UNQUOTED=%VERSION_LINE:"='%
|
||||
for /f "tokens=4 delims='" %%i in ("%UNQUOTED%") do set VERSION=%%i
|
||||
|
||||
for /f "delims=" %%i in ('dir /b screen-translator-online*.exe') do set online=%%i
|
||||
for /f "delims=" %%i in ('dir /b screen-translator-offline*.exe') do set offline=%%i
|
||||
|
||||
|
||||
winscp.com /keygen %SELF_PATH%\sf_key /output=key.ppk
|
||||
set folder="/home/frs/project/screen-translator/bin/v%VERSION%"
|
||||
winscp.com /command "open sftp://onemoregres@frs.sourceforge.net/ -privatekey=key.ppk -hostkey=*" "mkdir %folder%" "put %online% %folder%/%online%" "put %offline% %folder%/%offline%" "exit"
|
||||
|
||||
|
||||
set url="https://sourceforge.net/projects/screen-translator/files/bin/v%VERSION%/%online%"
|
||||
curl --insecure -H "Accept: application/json" -X PUT -d "default=windows" -d "api_key=%sf_api%" %url%
|
||||
|
||||
set url="https://sourceforge.net/projects/screen-translator/files/bin/v%VERSION%/%offline%"
|
||||
curl --insecure -H "Accept: application/json" -X PUT -d "default=windows" -d "api_key=%sf_api%" %url%
|
19
scripts/win/env.bat
Normal file
19
scripts/win/env.bat
Normal file
@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
|
||||
if "%ARCH%" == "" set ARCH=x86
|
||||
|
||||
if /i %ARCH% == x86 goto x86
|
||||
if /i %ARCH% == x64 goto x64
|
||||
goto end
|
||||
|
||||
:x64
|
||||
call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
|
||||
set PATH=c:\Qt\5.5\msvc2013_64\bin\;c:\Program Files (x86)\NSIS\;C:\Program Files (x86)\Inno Setup 5;C:\Program Files\CMake\bin;%PATH%
|
||||
goto end
|
||||
|
||||
:x86
|
||||
call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
|
||||
set PATH=c:\Qt\5.5\msvc2013\bin\;c:\Program Files (x86)\NSIS\;C:\Program Files (x86)\Inno Setup 5;C:\Program Files\CMake\bin;%PATH%
|
||||
goto end
|
||||
|
||||
:end
|
111
scripts/win/prepare.bat
Normal file
111
scripts/win/prepare.bat
Normal file
@ -0,0 +1,111 @@
|
||||
@echo off
|
||||
|
||||
set SELF_PATH=%~dp0
|
||||
call %SELF_PATH%\env.bat
|
||||
|
||||
rem choco install curl cmake
|
||||
|
||||
mkdir download
|
||||
|
||||
if "%WITH_TESSDATA%" == "" goto libs
|
||||
echo "Downloading tessdata"
|
||||
mkdir download\tessdata
|
||||
cd download\tessdata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.bigrams
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.fold
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.lm
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.params
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.size
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.cube.word-freq
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/ara.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/chi_sim.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/deu.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.bigrams
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.fold
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.lm
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.params
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.size
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.cube.word-freq
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.tesseract_cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/eng.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.bigrams
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.fold
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.lm
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.params
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.size
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.cube.word-freq
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.tesseract_cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/fra.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/frk.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/frm.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/jpn.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.fold
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.lm
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.params
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.size
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.cube.word-freq
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/rus.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.bigrams
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.fold
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.lm
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.nn
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.params
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.size
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube.word-freq
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.traineddata
|
||||
curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa_old.traineddata
|
||||
cd ..\..
|
||||
:libs
|
||||
|
||||
|
||||
if "%CLEAR_CACHE%" == "" goto build-libs
|
||||
echo "Clearing cache"
|
||||
rmdir /s /q leptonica
|
||||
rmdir /s /q leptonica-build
|
||||
rmdir /s /q tesseract
|
||||
rmdir /s /q leptonica-build
|
||||
rmdir /s /q installed
|
||||
:build-libs
|
||||
|
||||
|
||||
if exist installed\bin\tesseract*.dll goto end
|
||||
|
||||
echo "Downloading dependencies"
|
||||
if not exist download\leptonica.zip (
|
||||
curl -fsSLk -o download\leptonica.zip https://github.com/DanBloomberg/leptonica/archive/1.74.4.zip
|
||||
)
|
||||
if not exist download\tesseract.zip (
|
||||
curl -fsSLk -o download\tesseract.zip https://github.com/tesseract-Ocr/tesseract/archive/3.05.01.zip
|
||||
)
|
||||
|
||||
|
||||
echo "Building dependencies"
|
||||
unzip -qq download\leptonica.zip
|
||||
move leptonica* leptonica
|
||||
mkdir leptonica-build
|
||||
cd leptonica-build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET_CPU=%ARCH% -DCMAKE_INSTALL_PREFIX=..\installed ..\leptonica
|
||||
cmake --build . --config Release
|
||||
cmake --build . --config Release --target install
|
||||
cd ..
|
||||
copy /y /b installed\lib\leptonica*.lib installed\lib\lept.lib
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
|
||||
unzip -qq download\tesseract.zip
|
||||
move tesseract* tesseract
|
||||
mkdir tesseract-build
|
||||
cd tesseract-build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET_CPU=%ARCH% -DCMAKE_INSTALL_PREFIX=..\installed -DCMAKE_PREFIX_PATH=..\installed ..\tesseract
|
||||
cmake --build . --config Release
|
||||
cmake --build . --config Release --target install
|
||||
cd ..
|
||||
copy /y /b installed\lib\tesseract*.lib installed\lib\tesseract.lib
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
:end
|
||||
|
BIN
scripts/win/sf_key.av
Normal file
BIN
scripts/win/sf_key.av
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user