From 99f80b2ac44cf08af9038db6d7dbad2f00e7742d Mon Sep 17 00:00:00 2001 From: Kelvin Sarink Date: Tue, 10 Jan 2023 15:48:12 +0100 Subject: [PATCH] add package to ci --- .github/workflows/maven-publish.yml | 20 +++++++++++++++++++- .gitignore | 3 ++- JPackage-appimage.txt | 8 ++++++++ JPackage-deb.txt | 12 ++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 JPackage-appimage.txt create mode 100644 JPackage-deb.txt diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 9a0f125..70b2925 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -24,10 +24,28 @@ jobs: run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$(git describe --tags) - name: Build with Maven run: mvn -B package --file pom.xml + - name: JPackage preparation + run: | + mkdir -p ./dist/jar/ + cp target/SPMLauncher-*.jar ./dist/jar/ + - name: JPackage AppImage + run: | + jpackage --main-jar SPMLauncher-$(git describe --tags).jar --app-version $(git describe --tags) @JPackage-appimage.txt + cd dist + tar cfz spmlauncher_$(git describe --tags)_amd64-appimage.tar.gz SPMLauncher/ + rm -rf SPMLauncher/ + cd .. + - name: JPackage deb + run: jpackage --main-jar SPMLauncher-$(git describe --tags).jar --app-version $(git describe --tags) @JPackage-deb.txt + - name: Clean dist dir + run: | + cd dist + mv jar/* . + rmdir jar - name: Release uses: softprops/action-gh-release@v1 with: - files: target/SPMLauncher-*.jar + files: dist/* name: SPMLauncher v${{ github.event.release.tag_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 6c9ed8f..9659325 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ *.tar.gz *.rar +dist/ target/ pom.xml.tag pom.xml.releaseBackup @@ -33,4 +34,4 @@ buildNumber.properties # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) !/.mvn/wrapper/maven-wrapper.jar -# Add any directories, files, or patterns you don't want to be tracked by version control \ No newline at end of file +# Add any directories, files, or patterns you don't want to be tracked by version control diff --git a/JPackage-appimage.txt b/JPackage-appimage.txt new file mode 100644 index 0000000..0aa68b4 --- /dev/null +++ b/JPackage-appimage.txt @@ -0,0 +1,8 @@ +--name SPMLauncher +--type app-image +--input ./dist/jar/ +--dest ./dist/ +--icon ./src/main/resources/spm12.png +--copyright GPLv3 +--description "SPMLauncher provides an overview over your SPM and MATLAB installations, allows you to quickly enable or disable toolboxes and switch versions." +--vendor "University of Muenster, Institute for Translational Psychiatry" diff --git a/JPackage-deb.txt b/JPackage-deb.txt new file mode 100644 index 0000000..1d54602 --- /dev/null +++ b/JPackage-deb.txt @@ -0,0 +1,12 @@ +--name SPMLauncher +--type app-image +--input ./dist/jar/ +--dest ./dist/ +--icon ./src/main/resources/spm12.png +--copyright GPLv3 +--description "SPMLauncher provides an overview over your SPM and MATLAB installations, allows you to quickly enable or disable toolboxes and switch versions." +--vendor "University of Muenster, Institute for Translational Psychiatry" +--about-url "https://github.com/wwu-trap/spmlauncher" +--license-file LICENSE +--linux-package-deps bubblewrap +--linux-shortcut