mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 19:49:32 +00:00
support AppImage packaging (#1270)
This commit is contained in:
parent
ea3f099df7
commit
61158e9750
8 changed files with 94 additions and 2 deletions
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
|
@ -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
|
||||
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
|
||||
|
|
1
desktop/package/linux/Haveno.AppDir/.DirIcon
Symbolic link
1
desktop/package/linux/Haveno.AppDir/.DirIcon
Symbolic link
|
@ -0,0 +1 @@
|
|||
../haveno.png
|
|
@ -0,0 +1 @@
|
|||
../Haveno.desktop
|
1
desktop/package/linux/Haveno.AppDir/haveno.svg
Symbolic link
1
desktop/package/linux/Haveno.AppDir/haveno.svg
Symbolic link
|
@ -0,0 +1 @@
|
|||
../haveno.svg
|
13
desktop/package/linux/Haveno.desktop
Normal file
13
desktop/package/linux/Haveno.desktop
Normal file
|
@ -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
|
BIN
desktop/package/linux/haveno.png
Normal file
BIN
desktop/package/linux/haveno.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
1
desktop/package/linux/haveno.svg
Normal file
1
desktop/package/linux/haveno.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><style>.cls-1{fill:#f1482d;}.cls-2,.cls-3{fill:#232075;}.cls-2{opacity:0.22;}.cls-3{opacity:0.44;}.cls-4{fill:#fff;}</style></defs><title>haveno_logo_icon</title><g id="Layer_1_copy" data-name="Layer 1 copy"><polygon class="cls-1" points="469.37 155.08 499.53 162.84 511.62 177.19 557.71 207.42 563.75 212.71 576.6 268.62 585.67 276.94 590.96 270.13 638.25 296.94 654.12 312.05 646.12 375.92 630.25 376.68 630.25 386.5 646.12 432.59 584.91 556.51 581.89 568.6 547.89 591.27 504.06 616.96 468.37 618.08 434.54 647.19 358.23 666.08 349.92 639.63 318.18 632.08 170.08 518.73 188.97 501.35 167.06 486.24 149.37 331.08 232.04 173.41 268.31 162.84 275.11 168.13 290.98 168.88 303.07 158.3 329.37 138.08 379.37 125.08 395.37 160.08 422.37 186.08 469.37 155.08"/><path class="cls-2" d="M510.93,216.49c24.31,7.8,36.09,30,57.63,72,23.3,45.44,35,68.16,26.9,88-9.52,23.41-38.88,31.5-35.86,48,1.51,8.27,9.51,9.62,11.52,20,2.61,13.4-7.81,26.12-11.52,30.66-28.3,34.58-68,16.05-103.74,49.32-12.79,11.91-6.63,13.27-32,44-22.74,27.53-34.11,41.29-48.66,44-28.25,5.24-58.53-24.33-73-49.32-18.74-32.38-4-45.06-21.77-78.65-20.61-38.91-46.78-33.88-61.47-70.64-10.55-26.37-6-51.37-2.57-70.65,3.21-17.82,13.66-75.79,52.51-94.64,37.83-18.37,56.84,22.57,110.14,8,33-9,41.66-29.07,89.65-38.65C486.59,214.25,497.55,212.2,510.93,216.49Z"/><path class="cls-3" d="M413.19,283c-32.8.14-104,.43-140.55,35.6-2.81,2.7-31,30.48-16.53,49.39,14,18.27,53.54,9.53,71.1,28.71,14.09,15.39-6,26.91-1.65,58.57,3.33,24.47,21.26,61.11,56.22,66.61,25.76,4.06,50.3-10.45,57.87-14.93,37.64-22.26,41.7-57.59,43-71.2,4.72-49.9-31.83-68.23-11.57-99.92,12.89-20.17,35.64-25.19,31.41-35.61C495.35,282.64,424.89,282.94,413.19,283Z"/><path class="cls-3" d="M342.76,336.08c6.17-12.18,41.43-22.94,66.07-14,14.5,5.26,22.66,16.39,20.94,26-2,11-4.24,13.62-9.77,24.92-7.46,15.25,13.11,19,15,40,1.67,18.59-23.39,40.09-32.62,40.08-60.38-.08.71-46.44-45.12-92C348.72,352.58,338.47,344.52,342.76,336.08Z"/></g><g id="Layer_4" data-name="Layer 4"><path class="cls-4" d="M354.58,380.91h94.33v-97h65.33V535.23H448.91v-103H354.58v103H289.26V283.92h65.32Z"/><circle class="cls-4" cx="402" cy="229" r="33"/></g></svg>
|
After Width: | Height: | Size: 2.2 KiB |
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue