From e6a3a5d158c274beeaabea447417224a89e54ae6 Mon Sep 17 00:00:00 2001 From: Gres Date: Sat, 5 Aug 2017 16:10:15 +0300 Subject: [PATCH 1/8] First version. --- .appveyor.yml | 32 +++++++++++++ scripts/win/build.bat | 59 +++++++++++++++++++++++ scripts/win/env.bat | 19 ++++++++ scripts/win/prepare.bat | 101 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 211 insertions(+) create mode 100644 .appveyor.yml create mode 100644 scripts/win/build.bat create mode 100644 scripts/win/env.bat create mode 100644 scripts/win/prepare.bat diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..65012b8 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,32 @@ +image: Visual Studio 2015 + +environment: + ARCH: x86 + +clone_depth: 1 + +platform: + - x64 + +init: + - if /i %APPVEYOR_REPO_TAG% == true set WITH_TESSDATA=1 + +install: + - 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 diff --git a/scripts/win/build.bat b/scripts/win/build.bat new file mode 100644 index 0000000..bdec605 --- /dev/null +++ b/scripts/win/build.bat @@ -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 \ No newline at end of file diff --git a/scripts/win/env.bat b/scripts/win/env.bat new file mode 100644 index 0000000..61722ad --- /dev/null +++ b/scripts/win/env.bat @@ -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 diff --git a/scripts/win/prepare.bat b/scripts/win/prepare.bat new file mode 100644 index 0000000..21e4f93 --- /dev/null +++ b/scripts/win/prepare.bat @@ -0,0 +1,101 @@ +@echo off + +set SELF_PATH=%~dp0 +call %SELF_PATH%\env.bat + +rem choco install curl cmake + +mkdir download +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 +) + + +if "%WITH_TESSDATA%" == "" goto build + +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 ..\.. + + +:build + +rmdir /s /q installed + +rmdir /s /q leptonica +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% + + +rmdir /s /q tesseract +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% + + + From 280175e9c2ee75c6ba1c1e2b0aba4a6f1bb72676 Mon Sep 17 00:00:00 2001 From: Gres Date: Sat, 5 Aug 2017 16:18:59 +0300 Subject: [PATCH 2/8] Added appveyour status shield. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1aa8631..1b74079 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ [![Build Status](https://travis-ci.org/OneMoreGres/ScreenTranslator.svg)](https://travis-ci.org/OneMoreGres/ScreenTranslator.svg) +[![appveyor](https://img.shields.io/appveyor/ci/OneMoreGres/ScreenTranslator.svg)](https://img.shields.io/appveyor/ci/OneMoreGres/ScreenTranslator.svg) + Screen Translator ================= From 5800c239893d568044c714d06f465399c89c1221 Mon Sep 17 00:00:00 2001 From: Gres Date: Sun, 6 Aug 2017 11:50:05 +0300 Subject: [PATCH 3/8] Added dependencies caching. --- .appveyor.yml | 5 ++++- scripts/win/prepare.bat | 40 +++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 65012b8..eb77853 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -10,7 +10,10 @@ platform: init: - if /i %APPVEYOR_REPO_TAG% == true set WITH_TESSDATA=1 - + +cache: + - installed -> scripts\win\prepare.bat + install: - call "scripts\win\prepare.bat" diff --git a/scripts/win/prepare.bat b/scripts/win/prepare.bat index 21e4f93..40b96b3 100644 --- a/scripts/win/prepare.bat +++ b/scripts/win/prepare.bat @@ -6,16 +6,9 @@ call %SELF_PATH%\env.bat rem choco install curl cmake mkdir download -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 -) - - -if "%WITH_TESSDATA%" == "" goto build +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 @@ -66,13 +59,31 @@ curl -fsSLk -O https://github.com/tesseract-Ocr/tessdata/raw/3.04.00/spa.cube. 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 -:build - -rmdir /s /q installed - +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 @@ -85,7 +96,6 @@ copy /y /b installed\lib\leptonica*.lib installed\lib\lept.lib if %errorlevel% neq 0 exit /b %errorlevel% -rmdir /s /q tesseract unzip -qq download\tesseract.zip move tesseract* tesseract mkdir tesseract-build @@ -97,5 +107,5 @@ cd .. copy /y /b installed\lib\tesseract*.lib installed\lib\tesseract.lib if %errorlevel% neq 0 exit /b %errorlevel% - +:end From 9ecf4c27fbf0568d6507a58ead637c2be6b21915 Mon Sep 17 00:00:00 2001 From: Gres Date: Mon, 7 Aug 2017 11:04:01 +0300 Subject: [PATCH 4/8] Added upload to sourceforge. --- .appveyor.yml | 12 ++++++++++++ scripts/win/deploy_sf.bat | 26 ++++++++++++++++++++++++++ scripts/win/sf_key.av | Bin 0 -> 3248 bytes 3 files changed, 38 insertions(+) create mode 100644 scripts/win/deploy_sf.bat create mode 100644 scripts/win/sf_key.av diff --git a/.appveyor.yml b/.appveyor.yml index eb77853..94ef7e2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,6 +8,12 @@ clone_depth: 1 platform: - x64 +environment: + sf_secret: + secure: 8QOHSPQLI/lmjgOhyGOsMA5MxOdeSnlFWWKjntqEfBMfW/XCuiEk5tHNjZiiAw8N + sf_api: + secure: S4qrbAdLq3Hw5yozC7XAavTGzpPPh8MleX+r8kaueBtPZUeJGt+8EoqaPw0P1PzV + init: - if /i %APPVEYOR_REPO_TAG% == true set WITH_TESSDATA=1 @@ -15,6 +21,8 @@ cache: - installed -> scripts\win\prepare.bat install: + - cinst winscp + - nuget install secure-file -ExcludeVersion - call "scripts\win\prepare.bat" build_script: @@ -33,3 +41,7 @@ deploy: 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" diff --git a/scripts/win/deploy_sf.bat b/scripts/win/deploy_sf.bat new file mode 100644 index 0000000..ac7b229 --- /dev/null +++ b/scripts/win/deploy_sf.bat @@ -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% diff --git a/scripts/win/sf_key.av b/scripts/win/sf_key.av new file mode 100644 index 0000000000000000000000000000000000000000..dd403111bd053c7f6614688de3f5e0cba1cf7e05 GIT binary patch literal 3248 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 literal 0 HcmV?d00001 From 1bc25c174e30bd7072c897f72e0b619f9ff0f9d2 Mon Sep 17 00:00:00 2001 From: Gres Date: Mon, 7 Aug 2017 11:09:06 +0300 Subject: [PATCH 5/8] Merged environment sections. --- .appveyor.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 94ef7e2..e7863f0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,18 +2,16 @@ image: Visual Studio 2015 environment: ARCH: x86 - -clone_depth: 1 - -platform: - - x64 - -environment: 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 From 9a5738c4fd1f5dc4f2577ff1c23c261868996458 Mon Sep 17 00:00:00 2001 From: Gres Date: Mon, 7 Aug 2017 11:13:08 +0300 Subject: [PATCH 6/8] Check deployment. --- .appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index e7863f0..2e526cd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -21,10 +21,12 @@ cache: install: - cinst winscp - nuget install secure-file -ExcludeVersion + - secure-file\tools\secure-file -decrypt scripts\win\sf_key.av -secret %sf_secret% -out scripts\win\sf_key - call "scripts\win\prepare.bat" build_script: - call "scripts\win\build.bat" + - call "scripts\win\deploy_sf.bat" artifacts: - path: 'screen-translator-*.exe' @@ -40,6 +42,3 @@ deploy: 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" From 399824afb67c2a5ea81d6da1b63e4b73643d1608 Mon Sep 17 00:00:00 2001 From: Gres Date: Mon, 7 Aug 2017 11:20:57 +0300 Subject: [PATCH 7/8] Check only online installer with test version. --- scripts/win/deploy_sf.bat | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/win/deploy_sf.bat b/scripts/win/deploy_sf.bat index ac7b229..0a7187e 100644 --- a/scripts/win/deploy_sf.bat +++ b/scripts/win/deploy_sf.bat @@ -10,17 +10,20 @@ for /f "delims=" %%i in ('findstr versionString %ROOT%\version.json') do set VER 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 +set VERSION="debug" 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" +::winscp.com /command "open sftp://onemoregres@frs.sourceforge.net/ -privatekey=key.ppk -hostkey=*" "mkdir %folder%" "put %online% %folder%/%online%" "put %offline% %folder%/%offline%" "exit" +winscp.com /command "open sftp://onemoregres@frs.sourceforge.net/ -privatekey=key.ppk -hostkey=*" "mkdir %folder%" "put %online% %folder%/%online%" "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% +::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% From 1d609339f69ee5d284f88036971bd507ece73247 Mon Sep 17 00:00:00 2001 From: Gres Date: Mon, 7 Aug 2017 11:30:51 +0300 Subject: [PATCH 8/8] Deploy script back to normal. --- .appveyor.yml | 5 +++-- scripts/win/deploy_sf.bat | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 2e526cd..e7863f0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -21,12 +21,10 @@ cache: install: - cinst winscp - nuget install secure-file -ExcludeVersion - - secure-file\tools\secure-file -decrypt scripts\win\sf_key.av -secret %sf_secret% -out scripts\win\sf_key - call "scripts\win\prepare.bat" build_script: - call "scripts\win\build.bat" - - call "scripts\win\deploy_sf.bat" artifacts: - path: 'screen-translator-*.exe' @@ -42,3 +40,6 @@ deploy: 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" diff --git a/scripts/win/deploy_sf.bat b/scripts/win/deploy_sf.bat index 0a7187e..ac7b229 100644 --- a/scripts/win/deploy_sf.bat +++ b/scripts/win/deploy_sf.bat @@ -10,20 +10,17 @@ for /f "delims=" %%i in ('findstr versionString %ROOT%\version.json') do set VER 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 -set VERSION="debug" 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" -winscp.com /command "open sftp://onemoregres@frs.sourceforge.net/ -privatekey=key.ppk -hostkey=*" "mkdir %folder%" "put %online% %folder%/%online%" "exit" +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% +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%