Skip to content

Commit

Permalink
#151 Linux distribution CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
yermak committed Jan 28, 2021
1 parent 1b86fce commit 43c2722
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 34 deletions.
16 changes: 1 addition & 15 deletions build_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,7 @@ jobs:
export JAVAFX_JMODS=javafx-jmods-15.0.1
mvn clean package --no-transfer-progress
$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:$JAVAFX_JMODS \
--add-modules java.base,java.sql,javafx.controls,javafx.fxml,javafx.media,javafx.base,javafx.swing,javafx.graphics --output target/fx-jre
$JAVA_HOME/bin/jpackage --app-version $(APP_VERSION) -t app-image --name AudioBookConverter --vendor Recoupler \
--input target/package/audiobookconverter-$(APP_VERSION)-linux-installer/audiobookconverter-$(APP_VERSION)/app \
--main-jar lib/audiobookconverter-$(APP_VERSION).jar --runtime-image target/fx-jre --dest target/image --java-options '--enable-preview'
$JAVA_HOME/bin/jpackage --app-version $(APP_VERSION) --license-file LICENSE --icon AudioBookConverter.png \
-t deb --name AudioBookConverter --vendor Recoupler \
--linux-menu-group AudioBookConverter --linux-shortcut \
--input target/package/audiobookconverter-$(APP_VERSION)-linux-installer/audiobookconverter-$(APP_VERSION)/app \
--main-jar lib/audiobookconverter-$(APP_VERSION).jar --runtime-image target/fx-jre --java-options '--enable-preview'
mkdir target/release
mv audiobookconverter_$(APP_VERSION)-1_amd64.deb target/release/
call build/linux/package.sh $JAVA_HOME $JAVAFX_JMODS $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Build deb package'
Expand Down
16 changes: 1 addition & 15 deletions release-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,7 @@ jobs:
export JAVAFX_JMODS=javafx-jmods-15.0.1
mvn clean package --no-transfer-progress
$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:$JAVAFX_JMODS \
--add-modules java.base,java.sql,javafx.controls,javafx.fxml,javafx.media,javafx.base,javafx.swing,javafx.graphics --output target/fx-jre
$JAVA_HOME/bin/jpackage --app-version $(APP_VERSION) -t app-image --name AudioBookConverter --vendor Recoupler \
--input target/package/audiobookconverter-$(APP_VERSION)-linux-installer/audiobookconverter-$(APP_VERSION)/app \
--main-jar lib/audiobookconverter-$(APP_VERSION).jar --runtime-image target/fx-jre --dest target/image --java-options '--enable-preview'
$JAVA_HOME/bin/jpackage --app-version $(APP_VERSION) --license-file LICENSE --icon AudioBookConverter.png \
-t deb --name AudioBookConverter --vendor Recoupler \
--linux-menu-group AudioBookConverter --linux-shortcut \
--input target/package/audiobookconverter-$(APP_VERSION)-linux-installer/audiobookconverter-$(APP_VERSION)/app \
--main-jar lib/audiobookconverter-$(APP_VERSION).jar --runtime-image target/fx-jre --java-options '--enable-preview'
mkdir target/release
mv audiobookconverter_$(APP_VERSION)-1_amd64.deb target/release/
call build/linux/package.sh $JAVA_HOME $JAVAFX_JMODS $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Build deb package'
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/uk/yermak/audiobookconverter/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,18 @@ private static boolean isSupported() {
return isWindows() || isLinux();
}

public final static String FFMPEG = isSupported() ? new File(isWindows()?"":"../lib/"+"app/external/ffmpeg"+(isWindows()?".exe":"")).getAbsolutePath() : "ffmpeg";
public final static String FFMPEG = isSupported() ? new File(getFFMpegPath() + "/ffmpeg" + (isWindows() ? ".exe" : "")).getAbsolutePath() : "ffmpeg";

public static final String MP4ART = isSupported() ? new File(isWindows()?"":"../lib/"+"app/external/mp4art"+(isWindows()?".exe":"")).getAbsolutePath() : "mp4art";
private static String getFFMpegPath() {
if (System.getenv("FFMPEG") != null) return System.getenv("FFMPEG");
return (isWindows() ? "" : "../lib/") + "app/external";
}

public static final String MP4ART = isSupported() ? new File(getFFMpegPath() + "/mp4art" + (isWindows() ? ".exe" : "")).getAbsolutePath() : "mp4art";

public static final String MP4INFO = isSupported() ? new File(isWindows()?"":"../lib/"+"app/external/mp4info"+(isWindows()?".exe":"")).getAbsolutePath() : "mp4info";
public static final String MP4INFO = isSupported() ? new File(getFFMpegPath() + "/mp4info" + (isWindows() ? ".exe" : "")).getAbsolutePath() : "mp4info";

public static final String FFPROBE = isSupported() ? new File(isWindows()?"":"../lib/"+"app/external/ffprobe"+(isWindows()?".exe":"")).getAbsolutePath() : "ffprobe";
public static final String FFPROBE = isSupported() ? new File(getFFMpegPath() + "/ffprobe" + (isWindows() ? ".exe" : "")).getAbsolutePath() : "ffprobe";


}

0 comments on commit 43c2722

Please sign in to comment.