client
Clone or download
Modified Files
--- /dev/null
+++ b/.github/scripts/jpackage.bat
@@ -0,0 +1,28 @@
+set /p REQ_MODULES=<req_modules.txt
+set /p VERSION=<version.txt
+
+%JPACKAGE_HOME%\bin\jpackage ^
+--module-path %JAVAFX_JMODS%;target/lib/ ^
+--add-modules %REQ_MODULES% ^
+--name "Stream-Pi Client" ^
+--description "Stream-Pi Client" ^
+--copyright "Copyright 2019-21 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones)" ^
+--input target/lib ^
+--main-jar client-%VERSION%.jar ^
+--type exe ^
+--java-options "-Dprism.verbose=true -Djavafx.verbose=true -Dprism.dirtyopts=false" ^
+--main-class %MAIN_CLASS% ^
+--arguments "-DStream-Pi.startupRunnerFileName='Stream-Pi Client.exe'" ^
+--icon assets/windows-icon.ico ^
+--dest %INSTALL_DIR% ^
+--win-dir-chooser ^
+--win-menu ^
+--win-menu-group "Stream-Pi" ^
+--vendor "Stream-Pi"
+
+echo Done now renaming ..
+cd %INSTALL_DIR%
+echo run dir
+dir
+ren *.exe stream-pi-client-windows-x64-%VERSION%-installer.exe
+dir
\ No newline at end of file
--- /dev/null
+++ b/.github/scripts/jpackage.sh
@@ -0,0 +1,19 @@
+
+echo $REQ_MODULES
+echo $VERSION
+
+$JPACKAGE_HOME/bin/jpackage \
+--module-path $JAVAFX_JMODS/:target/lib/ \
+--add-modules $REQ_MODULES \
+--input target/lib \
+--main-jar client-$VERSION.jar \
+--main-class $MAIN_CLASS \
+--description "Stream-Pi Client" \
+--vendor "Stream-Pi" \
+--verbose \
+--copyright "Copyright 2019-21 Debayan Sutradhar (rnayabed), Samuel Quiñones (SamuelQuinones)" \
+--dest $INSTALL_DIR \
+--name 'Stream-Pi Client' \
+--java-options '-Dprism.verbose=true -Djavafx.verbose=true -Dprism.dirtyopts=false' \
+--arguments "-DStream-Pi.startupRunnerFileName='Stream-Pi Client'" \
+"$@"
--- 'a/.github/workflows/build.yml'
+++ /dev/null
@@ -1,35 +0,0 @@
-name: Build
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
-
-jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Setup Java and Maven Central
- uses: actions/setup-java@v1
- with:
- java-version: 11
- server-id: ossrh
- server-username: MAVEN_USERNAME
- server-password: MAVEN_PASSWORD
-
- - name: Verify project
- run: mvn clean verify
-
- - name: Deploy snapshots
- env:
- MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- run: |
- mvn deploy -DskipTests=true -Dgpg.skip
\ No newline at end of file
--- /dev/null
+++ b/.github/workflows/init.yml
@@ -0,0 +1,65 @@
+name: Initial Setup
+
+on: [push]
+
+
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Install packages
+ run: sudo apt install unzip
+ - uses: actions/checkout@v2
+ - name: Setup java
+ uses: joschi/setup-jdk@v2
+ with:
+ java-version: 16
+ - name: Locally install util, action-api, theme-api
+ run: |
+ git clone https://github.com/stream-pi/util
+ cd util
+ mvn clean install
+ git clone https://github.com/stream-pi/theme-api
+ cd theme-api
+ mvn clean install
+ git clone https://github.com/stream-pi/action-api
+ cd action-api
+ mvn clean install
+ - name: Setup JavaFX
+ run: |
+ 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
+ - name: Build Jars
+ run: |
+ mvn -X package
+ - name: Save built jars
+ uses: actions/upload-artifact@v2
+ with:
+ name: built-jars
+ path: target/lib/*
+ - name: Set Version
+ run: |
+ echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
+ - name: Calculate required modules
+ run: |
+ JDEPS_MODULES=$(jdeps --module-path $JAVAFX_SDK/:target/lib/ --print-module-deps --ignore-missing-deps target/lib/client-$VERSION.jar)
+ JAVAFX_MODULES=javafx.fxml,javafx.media,javafx.swing,javafx.web
+ echo "REQ_MODULES=$JDEPS_MODULES,$JAVAFX_MODULES" >> $GITHUB_ENV
+ env:
+ JAVAFX_SDK: /tmp/javafx-sdk-17/lib/
+ - name: Saving REQ_MODULES
+ run: |
+ echo $REQ_MODULES > req_modules.txt
+ - name: Uploading REQ_MODULES
+ uses: actions/upload-artifact@v2
+ with:
+ name: req_modules
+ path: req_modules.txt
+ - name: Saving VERSION
+ run: |
+ echo $VERSION > version.txt
+ - name: Uploading VERSION
+ uses: actions/upload-artifact@v2
+ with:
+ name: version
+ path: version.txt
\ No newline at end of file
--- /dev/null
+++ b/.github/workflows/linux.yml
@@ -0,0 +1,81 @@
+name: Build Linux
+on:
+ workflow_run:
+ workflows: ["Build Essential Actions"]
+ types:
+ - completed
+
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Install packages
+ run: sudo apt install xdg-utils libc6 xdg-utils zlib1g libpng16-16 libasound2 libbsd-dev zip libblkid1 libdbus-1-3 libexpat1 libgpg-error0 liblzma5 libmount1 libpcre3 libselinux1 libsystemd0 libuuid1
+ - uses: actions/checkout@v2
+ - name: Setup java
+ uses: joschi/setup-jdk@v2
+ with:
+ java-version: 16
+ - name: Setup JavaFX
+ run: |
+ wget -P /tmp https://download2.gluonhq.com/openjfx/17/openjfx-17-ea+11_linux-x64_bin-jmods.zip
+ unzip /tmp/openjfx-17-ea+11_linux-x64_bin-jmods.zip -d /tmp
+ - name: Download built jars
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: built-jars
+ path: target/lib/
+ - name: Download REQ_MODULES
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: req_modules
+ - name: Download VERSION
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: version
+ - name: Add VERSION to environment
+ run: |
+ echo "VERSION=$(<version.txt)" >> $GITHUB_ENV
+ - name: Add REQ_MODULES to environment
+ run: |
+ echo "REQ_MODULES=$(<req_modules.txt)" >> $GITHUB_ENV
+ - name: Create Bundle using JPackage
+ run: |
+ # Create DEB
+ .github/scripts/jpackage.sh \
+ --icon assets/linux-icon.png \
+ --app-version ${{ env.VERSION }} \
+ --linux-menu-group "Stream-Pi" \
+ --license-file LICENSE.txt \
+ --type deb
+
+ # Create App Image
+ .github/scripts/jpackage.sh \
+ --icon assets/linux-icon.png \
+ --app-version ${{ env.VERSION }} \
+ --type app-image
+
+ cd $INSTALL_DIR
+ mv *.deb stream-pi-client-linux-x64-${{ env.VERSION }}-debian.deb
+ mv 'Stream-Pi Client' stream-pi-client-${{ env.VERSION }}
+ zip -r stream-pi-client-linux-x64-${{ env.VERSION }}-executable.zip stream-pi-client-${{ env.VERSION }}
+ rm -r stream-pi-client-${{ env.VERSION }}
+ env:
+ MAIN_CLASS: com.stream_pi.client.Main
+ JAVAFX_JMODS: /tmp/javafx-jmods-17/
+ JPACKAGE_HOME: ${{ env.JAVA_HOME }}
+ INSTALL_DIR: target/install
+ - name: Saving Linux x64 DEB
+ uses: actions/upload-artifact@v2
+ with:
+ name: linux-deb
+ path: target/install/stream-pi-client-linux-x64-${{ env.VERSION }}-debian.deb
+ - name: Saving Linux x64 ZIP
+ uses: actions/upload-artifact@v2
+ with:
+ name: linux-zip
+ path: target/install/stream-pi-client-linux-x64-${{ env.VERSION }}-executable.zip
+
--- /dev/null
+++ b/.github/workflows/macos.yml
@@ -0,0 +1,63 @@
+name: Build MacOS
+on:
+ workflow_run:
+ workflows: ["Build Linux"]
+ types:
+ - completed
+
+jobs:
+ build:
+ runs-on: macos-10.15
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup java
+ uses: joschi/setup-jdk@v2
+ with:
+ java-version: 16
+ - name: Setup JavaFX
+ run: |
+ wget -P /tmp https://download2.gluonhq.com/openjfx/17/openjfx-17-ea+11_linux-x64_bin-jmods.zip
+ unzip /tmp/openjfx-17-ea+11_linux-x64_bin-jmods.zip -d /tmp
+ - name: Download built jars
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: built-jars
+ path: target/lib/
+ - name: Download REQ_MODULES
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: req_modules
+ - name: Download VERSION
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: version
+ - name: Add VERSION to environment
+ run: |
+ echo "VERSION=$(<version.txt)" >> $GITHUB_ENV
+ - name: Add REQ_MODULES to environment
+ run: |
+ echo "REQ_MODULES=$(<req_modules.txt)" >> $GITHUB_ENV
+ - name: Create Bundle using JPackage
+ run: |
+ # Create DMG
+ .github/scripts/jpackage.sh \
+ --icon assets/macos-icon.icns \
+ --license-file LICENSE.txt \
+ --type dmg
+
+ cd $INSTALL_DIR
+ mv *.dmg stream-pi-client-macos-x64-${{ env.VERSION }}.dmg
+ env:
+ MAIN_CLASS: com.stream_pi.client.Main
+ JAVAFX_JMODS: /tmp/javafx-jmods-17/
+ JPACKAGE_HOME: ${{ env.JAVA_HOME }}
+ INSTALL_DIR: target/install
+ - name: Saving MacOS x64 DMG
+ uses: actions/upload-artifact@v2
+ with:
+ name: macos-dmg
+ path: target/install/stream-pi-client-macos-x64-${{ env.VERSION }}.dmg
+
--- 'a/.github/workflows/release.yml'
+++ b/.github/workflows/release.yml
@@ -1,42 +1,60 @@
name: Release
+
on:
- push:
- tags:
- - '*'
+ workflow_run:
+ workflows: ["Build Windows"]
+ types:
+ - completed
jobs:
build:
- name: Build
- runs-on: ubuntu-latest
-
+ runs-on: ubuntu-20.04
steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Setup Java 11
- uses: actions/setup-java@v1
+ - name: Download VERSION
+ uses: dawidd6/action-download-artifact@v2
with:
- java-version: 11
-
- - name: Configure GIT
+ workflow: init.yml
+ name: version
+ - name: Add Version to environment
run: |
- git config user.name "${{ github.event.head_commit.committer.name }}"
- git config user.email "${{ github.event.head_commit.committer.email }}"
-
- - name: Release artifacts
- run: |
- mvn deploy -DskipTests=true -B -U -Prelease
+ echo "VERSION=$(<version.txt)" >> $GITHUB_ENV
+ - name: Download windows exe
+ uses: dawidd6/action-download-artifact@v2
with:
- server-id: ossrh
- server-username: ${{ secrets.SONATYPE_USERNAME }}
- server-password: ${{ secrets.SONATYPE_PASSWORD }}
- gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
-
- - name: Update new version
- run: |
- TAG=${GITHUB_REF/refs\/tags\//}
- newVersion=${TAG%.*}.$((${TAG##*.} + 1))
- mvn versions:set -DnewVersion=$newVersion-SNAPSHOT -DgenerateBackupPoms=false
- git commit pom.xml -m "Prepare development of $newVersion"
- git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY} HEAD:master
\ No newline at end of file
+ workflow: windows.yml
+ name: windows-exe
+ path: target/install
+ - name: Download linux deb
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: linux.yml
+ name: linux-deb
+ path: target/install
+ - name: Download linux zip
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: linux.yml
+ name: linux-zip
+ path: target/install
+ - name: Download MacOS dmg
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: macos.yml
+ name: macos-dmg
+ path: target/install
+ - name: Delete old release if exists
+ uses: dev-drprasad/delete-tag-and-release@v0.2.0
+ continue-on-error: true
+ with:
+ delete_release: true
+ tag_name: ${{ env.VERSION }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Release nightly build
+ uses: ncipollo/release-action@v1.8.6
+ with:
+ allowUpdates: true
+ name: Stream-Pi-Server ${{ env.VERSION }}
+ artifacts: target/install/*
+ token: ${{ secrets.GITHUB_TOKEN }}
+ tag: ${{ env.VERSION }}
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,52 @@
+name: Build Windows
+on:
+ workflow_run:
+ workflows: ["Build MacOS"]
+ types:
+ - completed
+
+jobs:
+ build:
+ runs-on: windows-2019
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup java
+ uses: joschi/setup-jdk@v2
+ with:
+ java-version: 16
+ - name: Download REQ_MODULES
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: req_modules
+ - name: Download VERSION
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: version
+ - name: Setup JavaFX
+ run: |
+ bitsadmin /Transfer DownsdfloadJavaFX https://download2.gluonhq.com/openjfx/17/openjfx-17-ea+11_linux-x64_bin-jmods.zip D:\openjfx-17-ea+11_linux-x64_bin-jmods.zip
+ Expand-Archive -Force D:\openjfx-17-ea+11_linux-x64_bin-jmods.zip D:\
+ - name: Download built jars
+ uses: dawidd6/action-download-artifact@v2
+ with:
+ workflow: init.yml
+ name: built-jars
+ path: target/lib/
+ - name: Create Bundle using JPackage
+ id: project
+ shell: cmd
+ run: |
+ call .github\scripts\jpackage.bat
+ env:
+ MAIN_CLASS: com.stream_pi.client.Main
+ JAVAFX_JMODS: D:\javafx-jmods-17\
+ JPACKAGE_HOME: ${{ env.JAVA_HOME }}
+ INSTALL_DIR: target/install
+ - name: Saving Windows x64 EXE
+ uses: actions/upload-artifact@v2
+ with:
+ name: windows-exe
+ path: target/install/*.exe
+
Binary files /dev/null and b/assets/linux-icon.png differ
Binary files /dev/null and b/assets/macos-icon.icns differ
Binary files /dev/null and b/assets/windows-icon.ico differ
--- 'a/pom.xml'
+++ b/pom.xml
@@ -35,6 +35,7 @@
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
+ <jar.plugin>2.3.1</jar.plugin>
</properties>
<dependencies>
@@ -140,6 +141,32 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/lib</outputDirectory>
+ <excludeGroupIds>org.openjfx</excludeGroupIds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${jar.plugin}</version>
+ <configuration>
+ <outputDirectory>target/lib/</outputDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>