mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
86 lines
3.3 KiB
YAML
86 lines
3.3 KiB
YAML
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
|
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
|
|
|
name: Native Libraries
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
tags:
|
|
- '[0-9]*'
|
|
paths:
|
|
- 'flatlaf-natives/**'
|
|
- '.github/workflows/natives.yml'
|
|
- 'gradle/wrapper/gradle-wrapper.properties'
|
|
- '!**.md'
|
|
- '!**/.settings/**'
|
|
|
|
jobs:
|
|
Natives:
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- windows-latest
|
|
- macos-latest
|
|
- ubuntu-latest
|
|
- ubuntu-24.04-arm
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: gradle/actions/wrapper-validation@v4
|
|
|
|
- name: install libxt-dev and libgtk-3-dev
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
|
|
run: sudo apt install libxt-dev libgtk-3-dev
|
|
|
|
- name: Download libgtk-3.so for arm64
|
|
if: matrix.os == 'ubuntu-latest'
|
|
working-directory: flatlaf-natives/flatlaf-natives-linux/lib/aarch64
|
|
run: |
|
|
pwd
|
|
ls -l /usr/lib/x86_64-linux-gnu/libgtk*
|
|
wget --no-verbose https://ports.ubuntu.com/pool/main/g/gtk%2b3.0/libgtk-3-0_3.24.18-1ubuntu1_arm64.deb
|
|
ls -l
|
|
ar -x libgtk-3-0_3.24.18-1ubuntu1_arm64.deb data.tar.xz
|
|
tar -xvf data.tar.xz --wildcards --to-stdout "./usr/lib/aarch64-linux-gnu/libgtk-3.so.0.*" > libgtk-3.so
|
|
rm libgtk-3-0_3.24.18-1ubuntu1_arm64.deb data.tar.xz
|
|
ls -l
|
|
|
|
- name: install g++-aarch64-linux-gnu
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: sudo apt install g++-aarch64-linux-gnu
|
|
|
|
- name: Setup Java 11
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 11
|
|
distribution: temurin
|
|
cache: gradle
|
|
|
|
- name: Build with Gradle
|
|
# --no-daemon is necessary on Windows otherwise caching Gradle would fail with:
|
|
# tar.exe: Couldn't open ~/.gradle/caches/modules-2/modules-2.lock: Permission denied
|
|
run: ./gradlew build-natives --no-daemon
|
|
|
|
- name: Set artifacts pattern
|
|
shell: bash
|
|
run: |
|
|
case ${{ matrix.os }} in
|
|
windows-latest) echo "artifactPattern=flatlaf-windows-*.dll" >> $GITHUB_ENV ;;
|
|
macos-latest) echo "artifactPattern=libflatlaf-macos-*.dylib" >> $GITHUB_ENV ;;
|
|
ubuntu-latest) echo "artifactPattern=libflatlaf-linux-x86_64.so" >> $GITHUB_ENV ;;
|
|
ubuntu-24.04-arm) echo "artifactPattern=libflatlaf-linux-arm64.so" >> $GITHUB_ENV ;;
|
|
esac
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: FlatLaf-natives-build-artifacts-${{ matrix.os }}
|
|
path: |
|
|
flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/${{ env.artifactPattern }}
|
|
flatlaf-natives/flatlaf-natives-*/build
|