2021-05-04 20:20:30 -04:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2024-03-19 22:03:47 -04:00
|
|
|
workflow_dispatch:
|
2021-05-04 20:20:30 -04:00
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**/README.md'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-09-25 18:56:28 -04:00
|
|
|
os: [ubuntu-22.04, macos-13, windows-latest]
|
2021-05-04 20:20:30 -04:00
|
|
|
fail-fast: false
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2024-03-09 10:36:37 -05:00
|
|
|
- uses: actions/checkout@v4
|
2021-05-04 20:20:30 -04:00
|
|
|
with:
|
|
|
|
lfs: true
|
2024-03-09 10:36:37 -05:00
|
|
|
- name: Set up JDK 21
|
|
|
|
uses: actions/setup-java@v4
|
2021-05-04 20:20:30 -04:00
|
|
|
with:
|
2024-03-09 10:36:37 -05:00
|
|
|
java-version: '21'
|
2021-05-04 20:20:30 -04:00
|
|
|
distribution: 'adopt'
|
2021-11-09 06:18:39 -05:00
|
|
|
cache: gradle
|
2022-09-30 05:54:51 -04:00
|
|
|
- name: Build with Gradle
|
|
|
|
run: ./gradlew build --stacktrace --scan
|
2024-05-09 18:03:00 -04:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: error-reports-${{ matrix.os }}
|
|
|
|
path: ${{ github.workspace }}/desktop/build/reports
|
2021-11-09 06:18:39 -05:00
|
|
|
- name: cache nodes dependencies
|
2023-03-17 13:43:33 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-11-09 06:18:39 -05:00
|
|
|
with:
|
|
|
|
name: cached-localnet
|
|
|
|
path: .localnet
|
2024-04-12 09:05:29 -04:00
|
|
|
- name: Install dependencies
|
2024-09-30 09:19:16 -04:00
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
2024-04-12 09:05:29 -04:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
2024-10-08 13:26:49 -04:00
|
|
|
sudo apt install -y rpm libfuse2 flatpak flatpak-builder appstream
|
|
|
|
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
2024-04-12 09:05:29 -04:00
|
|
|
- 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: .
|
2024-09-30 11:24:03 -04:00
|
|
|
|
|
|
|
# get version from jar
|
|
|
|
- name: Set Version Unix
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' || 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
|
|
|
|
|
2024-04-12 09:05:29 -04:00
|
|
|
- name: Move Release Files on Unix
|
2024-09-30 09:19:16 -04:00
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' }}
|
2024-04-12 09:05:29 -04:00
|
|
|
run: |
|
2024-09-30 09:19:16 -04:00
|
|
|
if [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then
|
2024-10-13 12:06:11 -04:00
|
|
|
mkdir ${{ github.workspace }}/release-linux-rpm
|
|
|
|
mkdir ${{ github.workspace }}/release-linux-deb
|
|
|
|
mkdir ${{ github.workspace }}/release-linux-flatpak
|
|
|
|
mkdir ${{ github.workspace }}/release-linux-appimage
|
|
|
|
mv desktop/build/temp-*/binaries/haveno-*.rpm ${{ github.workspace }}/release-linux-rpm/haveno-v${{ env.VERSION }}-linux-x86_64-installer.rpm
|
|
|
|
mv desktop/build/temp-*/binaries/haveno_*.deb ${{ github.workspace }}/release-linux-deb/haveno-v${{ env.VERSION }}-linux-x86_64-installer.deb
|
|
|
|
mv desktop/build/temp-*/binaries/*.flatpak ${{ github.workspace }}/release-linux-flatpak/haveno-v${{ env.VERSION }}-linux-x86_64.flatpak
|
|
|
|
mv desktop/build/temp-*/binaries/haveno_*.AppImage ${{ github.workspace }}/release-linux-appimage/haveno-v${{ env.VERSION }}-linux-x86_64.AppImage
|
|
|
|
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-deb
|
|
|
|
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-rpm
|
|
|
|
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-appimage
|
|
|
|
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-linux-flatpak
|
2024-04-12 09:05:29 -04:00
|
|
|
else
|
2024-10-13 12:06:11 -04:00
|
|
|
mkdir ${{ github.workspace }}/release-macos
|
|
|
|
mv desktop/build/temp-*/binaries/Haveno-*.dmg ${{ github.workspace }}/release-macos/haveno-v${{ env.VERSION }}-macos-installer.dmg
|
|
|
|
cp desktop/build/temp-*/binaries/desktop-*.jar.SHA-256 ${{ github.workspace }}/release-macos
|
2024-04-12 09:05:29 -04:00
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
- name: Move Release Files on Windows
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
run: |
|
2024-10-13 12:06:11 -04:00
|
|
|
mkdir ${{ github.workspace }}/release-windows
|
|
|
|
Move-Item -Path desktop\build\temp-*/binaries\Haveno-*.exe -Destination ${{ github.workspace }}/release-windows/haveno-v${{ env.VERSION }}-windows-installer.exe
|
|
|
|
Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release-windows
|
2024-04-12 09:05:29 -04:00
|
|
|
shell: powershell
|
2024-09-30 11:24:03 -04:00
|
|
|
|
|
|
|
# win
|
2024-04-12 09:05:29 -04:00
|
|
|
- uses: actions/upload-artifact@v3
|
2024-09-30 11:24:03 -04:00
|
|
|
name: "Windows artifacts"
|
|
|
|
if: ${{ matrix.os == 'windows-latest'}}
|
2024-04-12 09:05:29 -04:00
|
|
|
with:
|
2024-09-30 11:24:03 -04:00
|
|
|
name: haveno-windows
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-windows
|
2024-09-30 11:24:03 -04:00
|
|
|
# macos
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
name: "macOS artifacts"
|
|
|
|
if: ${{ matrix.os == 'macos-13' }}
|
|
|
|
with:
|
|
|
|
name: haveno-macos
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-macos
|
2024-09-30 11:24:03 -04:00
|
|
|
# linux
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
name: "Linux - deb artifact"
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
|
|
|
with:
|
|
|
|
name: haveno-linux-deb
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-linux-deb
|
2024-09-30 11:24:03 -04:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
name: "Linux - rpm artifact"
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
|
|
|
with:
|
|
|
|
name: haveno-linux-rpm
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-linux-rpm
|
2024-10-08 13:26:49 -04:00
|
|
|
|
2024-10-02 10:36:29 -04:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
name: "Linux - AppImage artifact"
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
|
|
|
with:
|
|
|
|
name: haveno-linux-appimage
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-linux-appimage
|
2024-10-08 13:26:49 -04:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
name: "Linux - flatpak artifact"
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
|
|
|
with:
|
|
|
|
name: haveno-linux-flatpak
|
2024-10-13 12:06:11 -04:00
|
|
|
path: ${{ github.workspace }}/release-linux-flatpak
|