Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Travis CI makes archives and uploads them GitHub releases (#108)
Browse files Browse the repository at this point in the history
* Travis CI makes archives and uploads them GitHub releases.

When a tag is pushed to GitHub, Travis CI will make zip files including
the executable jar for the current version and dependent libraries,
and then upload them to GitHub releases.

* Update for v0.0.25

* Remove unnecessary unzip call

* Remove erroneous -f unzip option

* Add Windows-specific resources to release artifact
  • Loading branch information
jkawamoto authored and kaloyan-raev committed Mar 28, 2018
1 parent d208a7a commit 36cf47c
Show file tree
Hide file tree
Showing 14 changed files with 297 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#######################################################################
# Copyright (C) 2017 Kaloyan Raev
# Copyright (C) 2017-2018 Kaloyan Raev and others
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -16,6 +16,33 @@
#######################################################################
language: java

env:
global:
- JAVA_LIBSTORJ_VERSION=0.8.1

install: true

script: mvn clean verify
script: mvn clean verify

before_deploy:
- mvn package
# Prepare a package for Windows
- curl -sSL https://github.com/Storj/java-libstorj/releases/download/$JAVA_LIBSTORJ_VERSION/java-libstorj-$JAVA_LIBSTORJ_VERSION-win64-dlls.zip -O
- unzip java-libstorj-$JAVA_LIBSTORJ_VERSION-win64-dlls.zip
- zip -j goobox-sync-storj-$TRAVIS_TAG-win64.zip java-libstorj-dlls-$JAVA_LIBSTORJ_VERSION/* src/main/resources/win64/* target/goobox-sync-storj-$TRAVIS_TAG.jar
# Prepare a package for macOS
- mkdir -p java-libstorj-$JAVA_LIBSTORJ_VERSION-mac-dylibs
- curl -sSL https://github.com/Storj/java-libstorj/releases/download/$JAVA_LIBSTORJ_VERSION/java-libstorj-$JAVA_LIBSTORJ_VERSION-macos-dylibs.tar.gz | tar -zxv -C java-libstorj-$JAVA_LIBSTORJ_VERSION-mac-dylibs
- zip -j goobox-sync-storj-$TRAVIS_TAG-darwin.zip java-libstorj-$JAVA_LIBSTORJ_VERSION-mac-dylibs/* src/main/resources/goobox-sync-storj target/goobox-sync-storj-$TRAVIS_TAG.jar

deploy:
provider: releases
api_key:
secure: S/q7PYrt2JxBvMyQbaKcVRAD8uCfWuca5ZTIE2euiOeI7ZLHhRItHrqAF/1LcOPhbwwg3Sit4yjlkAv5LYFCKWXH5lHMtzQTTxDJ06MoP7H8jjXquOJL3rxnfldmjRcwp7+JgoPp7HdwFVp3yVrJXLuMqRLMxOllbq9QMMj1cE85Tq6SrAxeujTkRGyAZXAQf0lsd0rl5jc1fxraTEcj8CseRcYAmkIYvmc7hpOEE4WFincYIfJz+o4WWYAIWOuwJ2TCfvCZfp2ibxDtykaUQgKwGaM0bc5LqsoqRBr6fNecsfw7KfLZKhqS+W1s3i+2UeJOgKrdjFi7jFbgi8CpJX0HxFrQX/yKkj4UfWF+5J+yAcvn9sq1hEUI8udKx+9jMvduRxViebGvJ/DgmkeJEvOumQ+Cd2cdTJJYVyX8NL9tVUQBg5biDoZ4qU+RIGzGIWvIRDVjynnl0nMTS0+RxPQM31a2cNnPeNgpqJAIxAjdShgM09fWyfnIds0WAu44eKt96IIfyXw564zTd6Rq4MODRIWxqUxOH8/7/3nMwI5tk4a/Rrhfd+svtHOJO71iMKTdNeGUmaigksPNdxHH72X98oHsH49DnafEgOkpUSIzy5ppFtXYqPygkaH589gqzwbADrXEy55BXoZKeQmD7iBRkx+YODydgoHA/1dyTGU=
skip_cleanup: true
file:
- goobox-sync-storj-$TRAVIS_TAG-win64.zip
- goobox-sync-storj-$TRAVIS_TAG-darwin.zip
on:
tags: true
repo: GooBox/goobox-sync-storj
2 changes: 2 additions & 0 deletions src/main/resources/goobox-sync-storj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
java -jar goobox-sync-storj-0.0.25.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
85 changes: 85 additions & 0 deletions src/main/resources/win64/goobox-sync-storj-debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem goobox-sync-storj startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem goobox-sync-storj app version
set GOOBOX_SYNC_STORJ_VERSION=0.0.25

@rem Add default JVM options here. You can also use JAVA_OPTS and GOOBOX_SYNC_STORJ_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-XX:+CreateMinidumpOnCrash -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=y

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

@rem Execute goobox-sync-storj
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GOOBOX_SYNC_STORJ_OPTS% -jar "%APP_HOME%\goobox-sync-storj-%GOOBOX_SYNC_STORJ_VERSION%.jar" %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GOOBOX_SYNC_STORJ_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GOOBOX_SYNC_STORJ_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
85 changes: 85 additions & 0 deletions src/main/resources/win64/goobox-sync-storj.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem goobox-sync-storj startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem goobox-sync-storj app version
set GOOBOX_SYNC_STORJ_VERSION=0.0.25

@rem Add default JVM options here. You can also use JAVA_OPTS and GOOBOX_SYNC_STORJ_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-XX:+CreateMinidumpOnCrash

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

@rem Execute goobox-sync-storj
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GOOBOX_SYNC_STORJ_OPTS% -jar "%APP_HOME%\goobox-sync-storj-%GOOBOX_SYNC_STORJ_VERSION%.jar" %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GOOBOX_SYNC_STORJ_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GOOBOX_SYNC_STORJ_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
86 changes: 86 additions & 0 deletions src/main/resources/win64/list-db.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem goobox-sync-storj startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem goobox-sync-storj app version
set GOOBOX_SYNC_STORJ_VERSION=0.0.25

@rem Add default JVM options here. You can also use JAVA_OPTS and GOOBOX_SYNC_STORJ_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-XX:+CreateMinidumpOnCrash
set GOOBOX_SYNC_STORJ_OPTS=-Dlogback.configurationFile=logback-disable.xml

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

@rem Execute goobox-sync-storj
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GOOBOX_SYNC_STORJ_OPTS% -cp "%APP_HOME%\goobox-sync-storj-%GOOBOX_SYNC_STORJ_VERSION%.jar" io.goobox.sync.storj.db.DB %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GOOBOX_SYNC_STORJ_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GOOBOX_SYNC_STORJ_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
5 changes: 5 additions & 0 deletions src/main/resources/win64/register-dlls.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
regsvr32 GooboxOverlay1OK_x64.dll
regsvr32 GooboxOverlay2Syncing_x64.dll
regsvr32 GooboxOverlay3Warning_x64.dll
regsvr32 GooboxOverlay4Error_x64.dll
regsvr32 GooboxContextMenus_x64.dll
5 changes: 5 additions & 0 deletions src/main/resources/win64/unregister-dlls.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
regsvr32 -u GooboxOverlay1OK_x64.dll
regsvr32 -u GooboxOverlay2Syncing_x64.dll
regsvr32 -u GooboxOverlay3Warning_x64.dll
regsvr32 -u GooboxOverlay4Error_x64.dll
regsvr32 -u GooboxContextMenus_x64.dll

0 comments on commit 36cf47c

Please sign in to comment.