Added upload to sourceforge.

This commit is contained in:
Gres 2017-08-07 11:04:01 +03:00
parent 5800c23989
commit 9ecf4c27fb
3 changed files with 38 additions and 0 deletions

View File

@ -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"

26
scripts/win/deploy_sf.bat Normal file
View 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%

BIN
scripts/win/sf_key.av Normal file

Binary file not shown.