diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62ea36f9d2e..ad18dea6631 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} run: | sudo apt update - sudo apt install -y rpm + sudo apt install -y rpm fuse - name: Install WiX Toolset if: ${{ matrix.os == 'windows-latest' }} run: | @@ -73,14 +73,17 @@ jobs: if [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then mkdir ${{ github.workspace }}/release-rpm mkdir ${{ github.workspace }}/release-deb + mkdir ${{ github.workspace }}/release-appimage mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release-rpm/Haveno-${{ env.VERSION }}-x86_64.rpm mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release-deb/Haveno-${{ env.VERSION }}-x86_64.deb + mv desktop/build/temp-*/binaries/haveno_*.AppImage ${{ github.workspace }}/release-appimage/Haveno-${{ env.VERSION }}-x86_64.AppImage else mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release/Haveno-${{ env.VERSION }}.dmg fi cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-deb cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-rpm + cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-appimage shell: bash - name: Move Release Files on Windows if: ${{ matrix.os == 'windows-latest' }} @@ -116,4 +119,10 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} with: name: haveno-linux-rpm - path: ${{ github.workspace }}/release-rpm \ No newline at end of file + path: ${{ github.workspace }}/release-rpm + - uses: actions/upload-artifact@v3 + name: "Linux - AppImage artifact" + if: ${{ matrix.os == 'ubuntu-22.04' }} + with: + name: haveno-linux-appimage + path: ${{ github.workspace }}/release-appimage diff --git a/desktop/package/linux/Haveno.AppDir/.DirIcon b/desktop/package/linux/Haveno.AppDir/.DirIcon new file mode 120000 index 00000000000..37b10e39827 --- /dev/null +++ b/desktop/package/linux/Haveno.AppDir/.DirIcon @@ -0,0 +1 @@ +../haveno.png \ No newline at end of file diff --git a/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop b/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop new file mode 120000 index 00000000000..3507a5b0f04 --- /dev/null +++ b/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop @@ -0,0 +1 @@ +../Haveno.desktop \ No newline at end of file diff --git a/desktop/package/linux/Haveno.AppDir/haveno.svg b/desktop/package/linux/Haveno.AppDir/haveno.svg new file mode 120000 index 00000000000..3fe12c49f82 --- /dev/null +++ b/desktop/package/linux/Haveno.AppDir/haveno.svg @@ -0,0 +1 @@ +../haveno.svg \ No newline at end of file diff --git a/desktop/package/linux/Haveno.desktop b/desktop/package/linux/Haveno.desktop new file mode 100644 index 00000000000..82add1740d4 --- /dev/null +++ b/desktop/package/linux/Haveno.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Comment=A decentralized, Tor-based, P2P Monero exchange network. +Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; bin/Haveno %u" +GenericName[en_US]=Monero Exchange +GenericName=Monero Exchange +Icon=haveno +Categories=Office;Finance;Java;P2P; +Name[en_US]=Haveno +Name=Haveno +Terminal=false +Type=Application +MimeType= +X-AppImage-Name=Haveno diff --git a/desktop/package/linux/haveno.png b/desktop/package/linux/haveno.png new file mode 100644 index 00000000000..681ac6acdb7 Binary files /dev/null and b/desktop/package/linux/haveno.png differ diff --git a/desktop/package/linux/haveno.svg b/desktop/package/linux/haveno.svg new file mode 100644 index 00000000000..6c94a5b6eaf --- /dev/null +++ b/desktop/package/linux/haveno.svg @@ -0,0 +1 @@ +haveno_logo_icon \ No newline at end of file diff --git a/desktop/package/package.gradle b/desktop/package/package.gradle index fd1fc81f43d..df41edb895d 100644 --- a/desktop/package/package.gradle +++ b/desktop/package/package.gradle @@ -113,6 +113,8 @@ task getJavaBinariesDownloadURLs { } } + ext.osKey = osKey + ext.jdk21Binary_DownloadURL = jdk21Binaries[osKey] ext.jdk21Binary_SHA256Hash = jdk21Binaries[osKey + '-sha256'] } @@ -321,6 +323,69 @@ task packageInstallers { " --linux-deb-maintainer noreply@haveno.exchange" + " --type deb") + // Clean jpackage temp folder, needs to be empty for the next packaging step (AppImage) + jpackageTempDir.deleteDir() + jpackageTempDir.mkdirs() + + executeCmd(jPackageFilePath + commonOpts + + " --dest \"${jpackageTempDir}\"" + + " --type app-image") + + // Path to the app-image directory: THIS IS NOT THE ACTUAL .AppImage FILE. + // See JPackage documentation on --type app-image for more. + String appImagePath = new String( + "\"${binariesFolderPath}/${appNameAndVendor}\"" + ) + + // Which version of AppImageTool to use + String AppImageToolVersion = "13"; + + // Download AppImageTool + Map AppImageToolBinaries = [ + 'linux' : "https://github.com/AppImage/AppImageKit/releases/download/${AppImageToolVersion}/appimagetool-x86_64.AppImage", + 'linux-aarch64' : "https://github.com/AppImage/AppImageKit/releases/download/${AppImageToolVersion}/appimagetool-aarch64.AppImage", + ] + + String osKey = getJavaBinariesDownloadURLs.property('osKey') + + File appDir = new File("${jpackageTempDir}/Haveno") + File templateAppDir = new File("${project(':desktop').projectDir}/package/linux/Haveno.AppDir") + File jpackDir = appDir + + appDir.mkdirs() + + File AppImageToolBinary = new File("${jpackageTempDir}/appimagetool.AppImage") + + // Adding a platform to the AppImageToolBinaries essentially adds it to the "supported" list of platforms able to make AppImages + // However, be warned that any platform that doesn't support unix `ln` and `chmod` will not work with the current method. + if (AppImageToolBinaries.containsKey(osKey)) { + println "Downloading ${AppImageToolBinaries[osKey]}" + ant.get(src: AppImageToolBinaries[osKey], dest: AppImageToolBinary) + println 'Download saved to ' + jpackageTempDir + + project.exec { + commandLine('chmod', '+x', AppImageToolBinary) + } + + copy { + from templateAppDir + into appDir + boolean includeEmptyDirs = true + } + + project.exec { + workingDir appDir + commandLine 'ln', '-s', 'bin/Haveno', 'AppRun' + } + + project.exec { + commandLine "${AppImageToolBinary}", appDir, "${binariesFolderPath}/haveno_${appVersion}.AppImage" + } + } else { + println "Your platform does not support AppImageTool ${AppImageToolVersion}" + } + + // Clean jpackage temp folder, needs to be empty for the next packaging step (rpm) jpackageTempDir.deleteDir() jpackageTempDir.mkdirs() @@ -345,6 +410,7 @@ task packageInstallers { from binariesFolderPath into envVariableSharedFolder } + executeCmd("open " + envVariableSharedFolder) } }