haveno/.github/workflows/build.yml

119 lines
4.6 KiB
YAML
Raw Normal View History

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:
- uses: actions/checkout@v4
2021-05-04 20:20:30 -04:00
with:
lfs: true
- name: Set up JDK 21
uses: actions/setup-java@v4
2021-05-04 20:20:30 -04:00
with:
java-version: '21'
2021-05-04 20:20:30 -04:00
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
2023-03-17 13:43:33 -04:00
uses: actions/upload-artifact@v3
with:
name: cached-localnet
path: .localnet
- name: Install dependencies
2024-09-30 09:19:16 -04:00
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
sudo apt update
sudo apt install -y rpm
- 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-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
- name: Move Release Files on Unix
2024-09-30 09:19:16 -04:00
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-13' }}
run: |
mkdir ${{ github.workspace }}/release
2024-09-30 09:19:16 -04:00
if [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then
mkdir ${{ github.workspace }}/release-rpm
mkdir ${{ github.workspace }}/release-deb
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
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
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/Haveno-${{ env.VERSION }}.exe
Move-Item -Path desktop\build\temp-*/binaries\desktop-*.jar.SHA-256 -Destination ${{ github.workspace }}/release
shell: powershell
# win
- uses: actions/upload-artifact@v3
name: "Windows artifacts"
if: ${{ matrix.os == 'windows-latest'}}
with:
name: haveno-windows
path: ${{ github.workspace }}/release
# macos
- uses: actions/upload-artifact@v3
name: "macOS artifacts"
if: ${{ matrix.os == 'macos-13' }}
with:
name: haveno-macos
path: ${{ github.workspace }}/release
# linux
- uses: actions/upload-artifact@v3
name: "Linux - deb artifact"
if: ${{ matrix.os == 'ubuntu-22.04' }}
with:
name: haveno-linux-deb
path: ${{ github.workspace }}/release-deb
- uses: actions/upload-artifact@v3
name: "Linux - rpm artifact"
if: ${{ matrix.os == 'ubuntu-22.04' }}
with:
name: haveno-linux-rpm
path: ${{ github.workspace }}/release-rpm