sigh #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- name: macos-latest | |
pretty: macos | |
- name: ubuntu-22.04 | |
pretty: linux | |
- name: windows-latest | |
pretty: windows | |
runs-on: ${{ matrix.platform.name }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Linux Cross Compilation | |
if: startsWith(matrix.platform.name, 'ubuntu') | |
run: | | |
echo Updating package list | |
sudo apt-get update | |
echo Installing i686 cross compilation packages | |
sudo apt-get install -y gcc-multilib g++-multilib | |
echo Installing aarch64 cross compilation packages | |
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
echo Installing arm cross compilation packages | |
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with Gradle | |
run: ./gradlew assemble | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
natives/targets/**/build/libs/*.jar | |
!natives/targets/**/build/libs/*-sources.jar | |
name: '${{ matrix.platform.pretty }}-natives.zip' | |
- name: Create Release | |
if: github.event_name == 'release' | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
natives/targets/**/build/libs/*.jar | |
!natives/targets/**/build/libs/*-sources.jar | |
tag_name: ${{ github.sha }} | |
body: ${{ github.sha }} | |
draft: true | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |