server

Clone or download

updated build date/time

Modified Files

name: Init
name: Init
on: [push]
on: [push]
jobs:
jobs:
init:
init:
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04
steps:
steps:
- name: Install packages
- name: Install packages
run: sudo apt install unzip
run: sudo apt install unzip
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Setup java
- name: Setup java
uses: joschi/setup-jdk@v2
uses: joschi/setup-jdk@v2
with:
with:
java-version: 16
java-version: 16
- name: Build actions
- name: Build actions
run: |
run: |
git clone https://github.com/stream-pi/essential-actions
git clone https://github.com/stream-pi/essential-actions
cd essential-actions
cd essential-actions
make build-all
make build-all
- name: Move actions to Default.zip
- name: Move actions to Default.zip
run: |
run: |
mv essential-actions/BuiltPlugins/ src/main/resources/com/stream_pi/server/
mv essential-actions/BuiltPlugins/ src/main/resources/com/stream_pi/server/
cd src/main/resources/com/stream_pi/server/
cd src/main/resources/com/stream_pi/server/
unzip Default.zip -d Default
unzip Default.zip -d Default
mv BuiltPlugins/* Default/Plugins/
mv BuiltPlugins/* Default/Plugins/
rm -r BuiltPlugins
rm -r BuiltPlugins
rm -rf Default.zip
rm -rf Default.zip
cd Default
cd Default
zip -r Default.zip *
zip -r Default.zip *
mv Default.zip ../
mv Default.zip ../
cd ../
cd ../
rm -r Default
rm -r Default
- name: Saving new Default.zip
- name: Saving new Default.zip
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2
with:
with:
name: default-zip
name: default-zip
path: src/main/resources/com/stream_pi/server/Default.zip
path: src/main/resources/com/stream_pi/server/Default.zip
- name: Setup JavaFX
- name: Setup JavaFX
run: |
run: |
wget -P /tmp https://download2.gluonhq.com/openjfx/17/openjfx-17-ea+11_linux-x64_bin-sdk.zip
wget -P /tmp https://download2.gluonhq.com/openjfx/17/openjfx-17-ea+11_linux-x64_bin-sdk.zip
unzip /tmp/openjfx-17-ea+11_linux-x64_bin-sdk.zip -d /tmp
unzip /tmp/openjfx-17-ea+11_linux-x64_bin-sdk.zip -d /tmp
- name: Set Timezone
- name: Set Timezone
uses: szenius/set-timezone@v1.0
uses: szenius/set-timezone@v1.0
with:
with:
timezoneLinux: "Asia/Kolkata"
timezoneLinux: "Asia/Kolkata"
- name: Build Jars
- name: Build Jars
run: |
run: |
echo $(date +'%d-%m-%Y %H:%M:%S %Z') > src/main/resources/com/stream_pi/server/build-date
echo $(date +'%d-%m-%Y %H:%M:%S %Z') > src/main/resources/com/stream_pi/server/build-date
echo Build Date/Time: cat src/main/resources/com/stream_pi/server/build-date
mvn -X package
mvn -X package
- name: Save built jars
- name: Save built jars
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2
with:
with:
name: built-jars
name: built-jars
path: target/lib/*
path: target/lib/*
- name: Set Version
- name: Set Version
run: |
run: |
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Calculate required modules
- name: Calculate required modules
run: |
run: |
JDEPS_MODULES=$(jdeps --module-path $JAVAFX_SDK/:target/lib/ --print-module-deps --ignore-missing-deps target/lib/server-$VERSION.jar)
JDEPS_MODULES=$(jdeps --module-path $JAVAFX_SDK/:target/lib/ --print-module-deps --ignore-missing-deps target/lib/server-$VERSION.jar)
JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web
JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web
echo "REQ_MODULES=$JDEPS_MODULES,$JAVAFX_MODULES" >> $GITHUB_ENV
echo "REQ_MODULES=$JDEPS_MODULES,$JAVAFX_MODULES" >> $GITHUB_ENV
env:
env:
JAVAFX_SDK: /tmp/javafx-sdk-17/lib/
JAVAFX_SDK: /tmp/javafx-sdk-17/lib/
- name: Saving REQ_MODULES
- name: Saving REQ_MODULES
run: |
run: |
echo $REQ_MODULES > req_modules.txt
echo $REQ_MODULES > req_modules.txt
- name: Uploading REQ_MODULES
- name: Uploading REQ_MODULES
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2
with:
with:
name: req_modules
name: req_modules
path: req_modules.txt
path: req_modules.txt
- name: Saving VERSION
- name: Saving VERSION
run: |
run: |
echo $VERSION > version.txt
echo $VERSION > version.txt
- name: Uploading VERSION
- name: Uploading VERSION
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2
with:
with:
name: version
name: version
path: version.txt
path: version.txt
package com.stream_pi.server.window.settings.About;
package com.stream_pi.server.window.settings.About;
import com.stream_pi.action_api.ActionAPI;
import com.stream_pi.action_api.ActionAPI;
import com.stream_pi.server.info.ServerInfo;
import com.stream_pi.server.info.ServerInfo;
import com.stream_pi.server.Main;
import com.stream_pi.server.Main;
import javafx.application.HostServices;
import javafx.application.HostServices;
import javafx.event.Event;
import javafx.event.Event;
import javafx.geometry.Pos;
import javafx.geometry.Pos;
import javafx.scene.CacheHint;
import javafx.scene.CacheHint;
import javafx.scene.control.*;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.ImageView;
import javafx.scene.input.SwipeEvent;
import javafx.scene.input.SwipeEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.layout.VBox;
import java.io.File;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.Objects;
import java.util.Scanner;
import java.util.Scanner;
import java.util.logging.Logger;
import java.util.logging.Logger;
public class About extends VBox
public class About extends VBox
{
{
private HostServices hostServices;
private HostServices hostServices;
public About(HostServices hostServices)
public About(HostServices hostServices)
{
{
getStyleClass().add("about");
getStyleClass().add("about");
this.hostServices = hostServices;
this.hostServices = hostServices;
setAlignment(Pos.TOP_CENTER);
setAlignment(Pos.TOP_CENTER);
Image appIcon = new Image(Objects.requireNonNull(Main.class.getResourceAsStream("app_icon.png")));
Image appIcon = new Image(Objects.requireNonNull(Main.class.getResourceAsStream("app_icon.png")));
ImageView appIconImageView = new ImageView(appIcon);
ImageView appIconImageView = new ImageView(appIcon);
appIconImageView.setFitHeight(196);
appIconImageView.setFitHeight(196);
appIconImageView.setFitWidth(182);
appIconImageView.setFitWidth(182);
TabPane tabPane = new TabPane();
TabPane tabPane = new TabPane();
tabPane.addEventFilter(SwipeEvent.ANY, Event::consume);
tabPane.addEventFilter(SwipeEvent.ANY, Event::consume);
tabPane.getStyleClass().add("settings_about_tab_internal");
tabPane.getStyleClass().add("settings_about_tab_internal");
tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
tabPane.setMaxWidth(600);
tabPane.setMaxWidth(600);
VBox.setVgrow(tabPane, Priority.ALWAYS);
VBox.setVgrow(tabPane, Priority.ALWAYS);
Tab licenseTab = new Tab("License");
Tab licenseTab = new Tab("License");
licenseTab.setContent(new LicenseTab());
licenseTab.setContent(new LicenseTab());
Tab contributorsTab = new Tab("Contributors");
Tab contributorsTab = new Tab("Contributors");
contributorsTab.setContent(new ContributorsTab());
contributorsTab.setContent(new ContributorsTab());
Tab contactTab = new Tab("Contact");
Tab contactTab = new Tab("Contact");
contactTab.setContent(new ContactTab(hostServices));
contactTab.setContent(new ContactTab(hostServices));
tabPane.getTabs().addAll(licenseTab, contributorsTab, contactTab);
tabPane.getTabs().addAll(licenseTab, contributorsTab, contactTab);
Hyperlink donateButton = new Hyperlink("DONATE");
Hyperlink donateButton = new Hyperlink("DONATE");
donateButton.setOnAction(event -> openWebpage("https://www.patreon.com/streampi"));
donateButton.setOnAction(event -> openWebpage("https://www.patreon.com/streampi"));
donateButton.getStyleClass().add("about_donate_hyperlink");
donateButton.getStyleClass().add("about_donate_hyperlink");
ServerInfo serverInfo = ServerInfo.getInstance();
ServerInfo serverInfo = ServerInfo.getInstance();
Label versionText = new Label(serverInfo.getVersion().getText() + " - "+ serverInfo.getPlatform().getUIName() + " - "+ serverInfo.getReleaseStatus().getUIName());
Label versionText = new Label(serverInfo.getVersion().getText() + " - "+ serverInfo.getPlatform().getUIName() + " - "+ serverInfo.getReleaseStatus().getUIName());
versionText.getStyleClass().add("about_version_label");
versionText.getStyleClass().add("about_version_label");
Label commStandardLabel = new Label("Comsssm Standard "+serverInfo.getCommStandardVersion().getText());
Label commStandardLabel = new Label("Comsssm Standard "+serverInfo.getCommStandardVersion().getText());
commStandardLabel.getStyleClass().add("about_comm_standard_label");
commStandardLabel.getStyleClass().add("about_comm_standard_label");
Label minThemeAPILabel = new Label("Min ThemeAPI "+serverInfo.getMinThemeSupportVersion().getText());
Label minThemeAPILabel = new Label("Min ThemeAPI "+serverInfo.getMinThemeSupportVersion().getText());
minThemeAPILabel.getStyleClass().add("about_min_theme_api_label");
minThemeAPILabel.getStyleClass().add("about_min_theme_api_label");
Label minActionAPILabel = new Label("Min ActionAPI "+serverInfo.getMinPluginSupportVersion().getText());
Label minActionAPILabel = new Label("Min ActionAPI "+serverInfo.getMinPluginSupportVersion().getText());
minActionAPILabel.getStyleClass().add("about_min_action_api_label");
minActionAPILabel.getStyleClass().add("about_min_action_api_label");
Label currentActionAPILabel = new Label("ActionAPI "+ ActionAPI.API_VERSION.getText());
Label currentActionAPILabel = new Label("ActionAPI "+ ActionAPI.API_VERSION.getText());
currentActionAPILabel.getStyleClass().add("about_current_action_api_label");
currentActionAPILabel.getStyleClass().add("about_current_action_api_label");
HBox hBox = new HBox(versionText, getSep(),
HBox hBox = new HBox(versionText, getSep(),
commStandardLabel, getSep(),
commStandardLabel, getSep(),
minThemeAPILabel, getSep(),
minThemeAPILabel, getSep(),
minActionAPILabel, getSep(),
minActionAPILabel, getSep(),
currentActionAPILabel);
currentActionAPILabel);
hBox.setAlignment(Pos.CENTER);
hBox.setAlignment(Pos.CENTER);
hBox.setSpacing(10);
hBox.setSpacing(10);
Label buildDateLabel = new Label();
Label buildDateLabel = new Label();
buildDateLabel.getStyleClass().add("build-date-label");
buildDateLabel.getStyleClass().add("build-date-label");
getChildren().addAll(appIconImageView, tabPane, donateButton, hBox, buildDateLabel);
getChildren().addAll(appIconImageView, tabPane, donateButton, hBox, buildDateLabel);
try
try
{
{
URL buildFile = Main.class.getResource("build-date");
buildDateLabel.setText("Build date/time: " + new String(Objects.requireNonNull(Main.class.getResourceAsStream("build-date")).readAllBytes()));
if(buildFile != null)
{
buildDateLabel.setText("Build date/time: "+ Files.readString(Paths.get(Objects.requireNonNull(buildFile.toURI().getPath()))));
}
else
{
buildDateLabel.setText("Build date/time not available.");
}
}
}
catch (Exception e)
catch (Exception e)
{
{
e.printStackTrace();
e.printStackTrace();
}
}
}
}
public void openWebpage(String url)
public void openWebpage(String url)
{
{
hostServices.showDocument(url);
hostServices.showDocument(url);
}
}
private Label getSep()
private Label getSep()
{
{
Label label = new Label("|");
Label label = new Label("|");
label.getStyleClass().add("separator_ui_label");
label.getStyleClass().add("separator_ui_label");
return label;
return label;
}
}
}
}