client
Clone or download
Modified Files
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
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'" \
"$@"
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
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
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
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
name: Release
name: Release
on:
on:
push:
workflow_run:
tags:
workflows: ["Build Windows"]
- '*'
types:
- completed
jobs:
jobs:
build:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
steps:
- name: Checkout
- name: Download VERSION
uses: actions/checkout@v2
uses: dawidd6/action-download-artifact@v2
- name: Setup Java 11
uses: actions/setup-java@v1
with:
with:
java-version: 11
workflow: init.yml
name: version
- name: Configure GIT
- name: Add Version to environment
run: |
run: |
git config user.name "${{ github.event.head_commit.committer.name }}"
echo "VERSION=$(<version.txt)" >> $GITHUB_ENV
git config user.email "${{ github.event.head_commit.committer.email }}"
- name: Download windows exe
uses: dawidd6/action-download-artifact@v2
- name: Release artifacts
run: |
mvn deploy -DskipTests=true -B -U -Prelease
with:
with:
server-id: ossrh
workflow: windows.yml
server-username: ${{ secrets.SONATYPE_USERNAME }}
name: windows-exe
server-password: ${{ secrets.SONATYPE_PASSWORD }}
path: target/install
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Download linux deb
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
uses: dawidd6/action-download-artifact@v2
with:
- name: Update new version
workflow: linux.yml
run: |
name: linux-deb
TAG=${GITHUB_REF/refs\/tags\//}
path: target/install
newVersion=${TAG%.*}.$((${TAG##*.} + 1))
- name: Download linux zip
mvn versions:set -DnewVersion=$newVersion-SNAPSHOT -DgenerateBackupPoms=false
uses: dawidd6/action-download-artifact@v2
git commit pom.xml -m "Prepare development of $newVersion"
with:
git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY} HEAD:master
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 }}
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
PNG