diff --git a/.github/workflows/build-pack-release.yml b/.github/workflows/build-pack-release.yml new file mode 100644 index 0000000..2ba9235 --- /dev/null +++ b/.github/workflows/build-pack-release.yml @@ -0,0 +1,332 @@ +name: Build, Pack, Release + +# Controls when the action will run. +on: + # Triggers the workflow on push but only for the master branch + pull_request: + types: [ closed ] + +jobs: + build-and-create-draft: + # Only run if it was a PR merge + if: github.event.pull_request.merged == true + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: CoocooFroggy + body-includes: FutureRestore GUI — v + direction: last + + - name: Parse comment + id: parse-comment + env: + COMMENT_BODY: ${{ steps.find-comment.outputs.comment-body }} + run: | + echo "Comment body is: $COMMENT_BODY" + version=$(echo "$COMMENT_BODY" | grep -Po '(?<=FutureRestore GUI — v).*') + echo "Version set to $version" + echo "::set-output name=version::$version" + echo $version > version.txt + release_body=$(echo "$COMMENT_BODY" | sed '1d') + echo "Release body set to $release_body" + echo "::set-output name=release-body::$release_body" + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Jar + run: ./gradlew shadowJar + # Upload this built jar + - name: Upload final jar + uses: actions/upload-artifact@v2 + with: + name: fat-jar + path: ./build/libs/FutureRestore GUI-1.0-all.jar + + - name: Upload version + uses: actions/upload-artifact@v2 + with: + name: version + path: version.txt + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.parse-comment.outputs.version }} + release_name: FutureRestore GUI — v${{ steps.parse-comment.outputs.version }} + body: ${{ steps.parse-comment.outputs.release-body }} + draft: true + prerelease: false + + - name: Create upload URL file + env: + UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} + run: echo $UPLOAD_URL > upload-url.txt + - name: Upload release's upload URL + uses: actions/upload-artifact@v2 + with: + name: upload-url + path: upload-url.txt + + - name: Create release ID file + env: + RELEASE_ID: ${{ steps.create_release.outputs.id }} + run: echo $RELEASE_ID > release-id.txt + - name: Upload release's upload URL + uses: actions/upload-artifact@v2 + with: + name: release-id + path: release-id.txt + + ubuntu-pack: + needs: [ build-and-create-draft ] + runs-on: ubuntu-latest + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Set up JDK 15 + uses: actions/setup-java@v1 + with: + java-version: 15 + + - name: Download final jar + uses: actions/download-artifact@v2 + with: + name: fat-jar + path: ./input + + - name: Download version + uses: actions/download-artifact@v2 + with: + name: version + - name: Output version + id: output-version + run: | + version=$(tail version.txt) + echo "::set-output name=version::$version" + + - name: Run JPackage deb + env: + RUN_NUMBER: ${{ github.run_number }} + VERSION: ${{ steps.output-version.outputs.version }} + run: jpackage --input ./input --name "FutureRestore GUI" --main-jar "FutureRestore GUI-1.0-all.jar" --main-class Main --type deb --icon ./.github/workflows/ubuntu/Icon-1024.png --copyright "© CoocooFroggy 2021" --verbose --name "FutureRestore GUI" --module-path ./.github/workflows/ubuntu/javafx-jmods-11.0.2 --add-modules javafx.swing,javafx.graphics,javafx.base,java.logging,java.sql,java.base,jdk.crypto.ec,java.naming --app-version $VERSION 2>&1 | tee /tmp/jpackoutput.txt + - name: Grep DEB name + id: grep_deb_name + run: | + deb_name=$(grep -Po '(?<=Package \(.deb\) saved to: ).*(?=.)' /tmp/jpackoutput.txt) + echo "::set-output name=deb_filename::$deb_name" + + - name: Run JPackage app-image + env: + RUN_NUMBER: ${{ github.run_number }} + VERSION: ${{ steps.output-version.outputs.version }} + run: jpackage --input ./input --name "FutureRestore GUI" --main-jar "FutureRestore GUI-1.0-all.jar" --main-class Main --type app-image --icon ./.github/workflows/ubuntu/Icon-1024.png --copyright "© CoocooFroggy 2021" --verbose --name "FutureRestore GUI" --module-path ./.github/workflows/ubuntu/javafx-jmods-11.0.2 --add-modules javafx.swing,javafx.graphics,javafx.base,java.logging,java.sql,java.base,jdk.crypto.ec,java.naming --app-version $VERSION + + - name: Zip app-image and run script + run: zip -r FutureRestore-GUI-Linux-Universal.zip "FutureRestore GUI" ./.github/workflows/ubuntu/"Run FutureRestore GUI.sh" + + - name: Download URL to upload to + uses: actions/download-artifact@v2 + with: + name: upload-url + # Make it usable in Github actions + - name: Set output for upload-url + id: set_upload_url + run: | + upload_url=$(tail upload-url.txt) + echo "::set-output name=upload-url::$upload_url" + + - name: Upload DEB to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload-url }} + asset_path: ${{ steps.grep_deb_name.outputs.deb_filename }} + asset_name: FutureRestore-GUI-Debian-${{ steps.output-version.outputs.version }}.deb + asset_content_type: application/octet-stream + + - name: Upload app-image zip to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload-url }} + asset_path: FutureRestore-GUI-Linux-Universal.zip + asset_name: FutureRestore-GUI-Linux-Universal-${{ steps.output-version.outputs.version }}.zip + asset_content_type: application/zip + + + + + macos-pack: + needs: [ build-and-create-draft ] + runs-on: macos-latest + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Set up JDK 15 + uses: actions/setup-java@v1 + with: + java-version: 15 + + - name: Download final jar + uses: actions/download-artifact@v2 + with: + name: fat-jar + path: ./input + + - name: Download version + uses: actions/download-artifact@v2 + with: + name: version + - name: Output version + id: output-version + run: | + version=$(tail version.txt) + echo "::set-output name=version::$version" + + - name: Run JPackage and remove signature + env: + RUN_NUMBER: ${{ github.run_number}} + VERSION: ${{ steps.output-version.outputs.version }} + run: | + jpackage --input ./input --main-jar "FutureRestore GUI-1.0-all.jar" --main-class Main --type app-image --icon ./.github/workflows/mac/FutureRestoreGUIIcons.icns --copyright "© CoocooFroggy 2021" --verbose --mac-package-identifier com.coocoofroggy.futurerestoregui --name "FutureRestore GUI" --module-path ./.github/workflows/mac/javafx-jmods-11.0.2 --add-modules javafx.swing,javafx.graphics,javafx.base,java.logging,java.sql,java.base,jdk.crypto.ec,java.naming --app-version $VERSION + codesign --remove-signature FutureRestore\ GUI.app + + - name: Zip .app + id: zip_app + run: zip -r FutureRestore-GUI-Mac.zip "FutureRestore GUI.app" + + - name: Download URL to upload to + uses: actions/download-artifact@v2 + with: + name: upload-url + # Make it usable in Github actions + - name: Set output for upload-url + id: set_upload_url + run: | + upload_url=$(tail upload-url.txt) + echo "::set-output name=upload-url::$upload_url" + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload-url }} + asset_path: FutureRestore-GUI-Mac.zip + asset_name: FutureRestore-GUI-Mac-${{ steps.output-version.outputs.version }}.zip + asset_content_type: application/zip + + windows-pack: + needs: [ build-and-create-draft ] + runs-on: windows-latest + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Set up JDK 15 + uses: actions/setup-java@v1 + with: + java-version: 15 + + - name: Download final jar + uses: actions/download-artifact@v2 + with: + name: fat-jar + path: ./input + + - name: Download version + uses: actions/download-artifact@v2 + with: + name: version + - name: Output version + id: output-version + run: | + FOR /F "tokens=*" %%g IN ('tail version.txt') do (SET version=%%g) + echo ::set-output name=version::%version% + shell: cmd + + - name: Run JPackage + env: + RUN_NUMBER: ${{ github.run_number }} + VERSION: ${{ steps.output-version.outputs.version }} + run: jpackage --input ./input --name "FutureRestore GUI" --main-jar "FutureRestore GUI-1.0-all.jar" --main-class Main --type msi --icon ./.github/workflows/windows/FRWindows.ico --copyright "© CoocooFroggy 2021" --verbose --name "FutureRestore GUI" --win-shortcut --win-menu --module-path ./.github/workflows/windows/javafx-jmods-11.0.2 --add-modules javafx.swing,javafx.graphics,javafx.base,java.logging,java.sql,java.base,jdk.crypto.ec,java.naming --app-version %VERSION% + shell: cmd + + - name: Find MSI name + id: grep_msi_name + run: | + FOR /F "tokens=*" %%g IN ('ls *.msi') do (SET msi_name=%%g) + echo ::set-output name=msi_filename::%msi_name% + # Otherwise it tries powershell + shell: cmd + + - name: Download URL to upload to + uses: actions/download-artifact@v2 + with: + name: upload-url + # Make it usable in Github actions + - name: Set output for upload-url + id: set_upload_url + run: | + FOR /F "tokens=*" %%g IN ('tail upload-url.txt') do (SET upload_url=%%g) + echo ::set-output name=upload-url::%upload_url% + # Otherwise it tries powershell + shell: cmd + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.set_upload_url.outputs.upload-url }} + asset_path: ${{ steps.grep_msi_name.outputs.msi_filename }} + asset_name: FutureRestore-GUI-Windows-${{ steps.output-version.outputs.version }}.msi + asset_content_type: application/octet-stream + + publish-release: + needs: [ ubuntu-pack, macos-pack, windows-pack ] + runs-on: ubuntu-latest + steps: + - name: Download release ID + uses: actions/download-artifact@v2 + with: + name: release-id + - name: Output release ID + id: output-release-id + run: | + release_id=$(tail release-id.txt) + echo "::set-output name=release-id::$release_id" + + - name: Publish release from draft + uses: StuYarrow/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + id: ${{ steps.output-release-id.outputs.release-id }} \ No newline at end of file diff --git a/.github/workflows/compile-java-11.yml b/.github/workflows/compile-java-11.yml new file mode 100644 index 0000000..8e7618d --- /dev/null +++ b/.github/workflows/compile-java-11.yml @@ -0,0 +1,39 @@ +# This is a basic workflow to help you get started with Actions + +name: ShadowJar with Java 11 + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build-and-upload: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Jar + run: ./gradlew shadowJar + +# Upload this built jar + - name: Upload final jar + uses: actions/upload-artifact@v2 + with: + name: fat-jar + path: ./build/libs/FutureRestore GUI-1.0-all.jar diff --git a/.github/workflows/mac/FutureRestoreGUIIcons.icns b/.github/workflows/mac/FutureRestoreGUIIcons.icns new file mode 100644 index 0000000..68d963b Binary files /dev/null and b/.github/workflows/mac/FutureRestoreGUIIcons.icns differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.base.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.base.jmod new file mode 100644 index 0000000..a54ac63 Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.base.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.controls.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.controls.jmod new file mode 100644 index 0000000..3339a9b Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.controls.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.fxml.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.fxml.jmod new file mode 100644 index 0000000..fdfd18c Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.fxml.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.graphics.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.graphics.jmod new file mode 100644 index 0000000..89fe2c5 Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.graphics.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.media.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.media.jmod new file mode 100644 index 0000000..24d3ed5 Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.media.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.swing.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.swing.jmod new file mode 100644 index 0000000..106f161 Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.swing.jmod differ diff --git a/.github/workflows/mac/javafx-jmods-11.0.2/javafx.web.jmod b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.web.jmod new file mode 100644 index 0000000..1e52780 Binary files /dev/null and b/.github/workflows/mac/javafx-jmods-11.0.2/javafx.web.jmod differ diff --git a/.github/workflows/ubuntu/Icon-1024.png b/.github/workflows/ubuntu/Icon-1024.png new file mode 100644 index 0000000..657e8ca Binary files /dev/null and b/.github/workflows/ubuntu/Icon-1024.png differ diff --git a/.github/workflows/ubuntu/Run FutureRestore GUI.sh b/.github/workflows/ubuntu/Run FutureRestore GUI.sh new file mode 100755 index 0000000..d81691b --- /dev/null +++ b/.github/workflows/ubuntu/Run FutureRestore GUI.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +FutureRestore\ GUI/bin/FutureRestore\ GUI diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.base.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.base.jmod new file mode 100644 index 0000000..41ece52 Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.base.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.controls.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.controls.jmod new file mode 100644 index 0000000..31be214 Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.controls.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.fxml.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.fxml.jmod new file mode 100644 index 0000000..9ece235 Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.fxml.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.graphics.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.graphics.jmod new file mode 100644 index 0000000..35aeccf Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.graphics.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.media.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.media.jmod new file mode 100644 index 0000000..8dbf620 Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.media.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.swing.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.swing.jmod new file mode 100644 index 0000000..0d23dc3 Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.swing.jmod differ diff --git a/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.web.jmod b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.web.jmod new file mode 100644 index 0000000..0a3cf6c Binary files /dev/null and b/.github/workflows/ubuntu/javafx-jmods-11.0.2/javafx.web.jmod differ diff --git a/.github/workflows/windows/FRWindows.ico b/.github/workflows/windows/FRWindows.ico new file mode 100644 index 0000000..f602c25 Binary files /dev/null and b/.github/workflows/windows/FRWindows.ico differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.base.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.base.jmod new file mode 100644 index 0000000..d418a51 Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.base.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.controls.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.controls.jmod new file mode 100644 index 0000000..4f306ed Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.controls.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.fxml.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.fxml.jmod new file mode 100644 index 0000000..f23bb5a Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.fxml.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.graphics.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.graphics.jmod new file mode 100644 index 0000000..c68830a Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.graphics.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.media.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.media.jmod new file mode 100644 index 0000000..1a13faa Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.media.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.swing.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.swing.jmod new file mode 100644 index 0000000..5374a2c Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.swing.jmod differ diff --git a/.github/workflows/windows/javafx-jmods-11.0.2/javafx.web.jmod b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.web.jmod new file mode 100644 index 0000000..645a704 Binary files /dev/null and b/.github/workflows/windows/javafx-jmods-11.0.2/javafx.web.jmod differ diff --git a/README.md b/README.md index cf400ec..b6e4931 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,14 @@ For GUI related issues, open an issue in the GitHub [issues section](https://git ## Contributing -Cloning the repository: +#### Cloning the repository: ``` git clone https://github.com/CoocooFroggy/FutureRestore-GUI.git ``` +#### Building: +Build a .jar with `gradle shadowjar`. Requires Java 11 or later. + +Package to a Windows .msi, Mac .app, or Linux .deb, .rpm, app-image with JPackage from Java 14 or later (continuous integration releases use Java 15). + Pull requests are welcome. For major feature requests, please open an issue to discuss what improvements you would like to see.