Skip to content

feat: add flatpak builds #3060

feat: add flatpak builds

feat: add flatpak builds #3060

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
pull_request:
paths-ignore:
- '**/README.md'
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Build with Gradle
run: ./gradlew build --stacktrace --scan
- uses: actions/upload-artifact@v3
if: failure()
with:
name: error-reports-${{ matrix.os }}
path: ${{ github.workspace }}/desktop/build/reports
- name: cache nodes dependencies
uses: actions/upload-artifact@v3
with:
name: cached-localnet
path: .localnet
- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt update
sudo apt install -y rpm flatpak flatpak-builder appstream
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Install WiX Toolset
if: ${{ matrix.os == 'windows-latest' }}
run: |
Invoke-WebRequest -Uri 'https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe' -OutFile wix314.exe
.\wix314.exe /quiet /norestart
shell: powershell
- name: Build Haveno Installer
run: |
./gradlew clean build --refresh-keys --refresh-dependencies
./gradlew packageInstallers
working-directory: .
# get version from jar
- name: Set Version Unix
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' }}
run: |
export VERSION=$(ls desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 | grep -Eo 'desktop-[0-9]+\.[0-9]+\.[0-9]+' | sed 's/desktop-//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set Version Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
$VERSION = (Get-ChildItem -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256).Name -replace 'desktop-', '' -replace '-.*', ''
"VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: powershell
- name: Move Release Files on Unix
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13' }}
run: |
mkdir ${{ github.workspace }}/release
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release
mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release
mv desktop/build/temp-*/binaries/*.flatpak ${{ github.workspace }}/release
else
mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release
fi
mv desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release
shell: bash
- name: Move Release Files on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
mkdir ${{ github.workspace }}/release
Move-Item -Path desktop\build\temp-*/binaries\Haveno-*.exe -Destination ${{ github.workspace }}/release
Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release
shell: powershell
# do all files manually and use version too
# win
- uses: actions/upload-artifact@v3
name: "Windows - exe artifact"
with:
name: windows-haveno-${{ env.VERSION }}.exe
path: ${{ github.workspace }}/release/Haveno-*.exe
# macos
- uses: actions/upload-artifact@v3
name: "MacOS - dmg artifact"
with:
name: macos-haveno-${{ env.VERSION }}.dmg
path: ${{ github.workspace }}/release/Haveno-*.dmg
# linux
- uses: actions/upload-artifact@v3
name: "Linux - deb artifact"
with:
name: linux-haveno-${{ env.VERSION }}.deb
path: ${{ github.workspace }}/release/haveno_*.deb
- uses: actions/upload-artifact@v3
name: "Linux - rpm artifact"
with:
name: linux-haveno-${{ env.VERSION }}.rpm
path: ${{ github.workspace }}/release/haveno-*.rpm
- uses: actions/upload-artifact@v3
name: "Linux - flatpak artifact"
with:
name: linux-haveno-${{ env.VERSION }}.flatpak
path: ${{ github.workspace }}/release/*.flatpak