fix: Set options.release for java 8 compatibility #34
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 and Publish | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
branches: [ master ] | |
release: | |
types: [ published ] | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
jobs: | |
natives-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Install additional build dependencies | |
run: brew install nasm | |
- name: Build with Gradle | |
run: ./gradlew :gdx-video-desktop:buildFFmpegMacosAll :gdx-video-desktop:jnigenBuildMacosAll | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: desktop-natives | |
path: gdx-video-desktop/libs/**/*.dylib | |
if-no-files-found: error | |
natives-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Install build dependencies and cross-compilation toolchains | |
run: | | |
sudo apt update | |
sudo apt install -y --force-yes gcc g++ | |
sudo apt install -y --force-yes nasm | |
sudo apt install -y --force-yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross | |
sudo apt install -y --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross | |
- name: Build natives with Gradle | |
run: ./gradlew :gdx-video-desktop:buildFFmpegLinuxAll :gdx-video-desktop:jnigenBuildLinuxAll | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: desktop-natives | |
path: gdx-video-desktop/libs/**/*.so | |
if-no-files-found: error | |
natives-windows: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Install build dependencies and cross-compilation toolchains | |
run: | | |
sudo apt update | |
sudo apt install -y --force-yes nasm | |
sudo apt install -y --force-yes mingw-w64 lib32z1 | |
- name: Build natives with Gradle | |
run: ./gradlew :gdx-video-desktop:buildFFmpegWindowsAll :gdx-video-desktop:jnigenBuildWindowsAll | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: desktop-natives | |
path: gdx-video-desktop/libs/**/*.dll | |
if-no-files-found: error | |
publish: | |
needs: | |
- natives-macos | |
- natives-linux | |
- natives-windows | |
runs-on: ubuntu-20.04 | |
env: | |
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Download desktop-natives artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: desktop-natives | |
path: gdx-video-desktop/libs | |
- name: Create JAR with natives for desktop | |
run: ./gradlew jnigenJarNativesDesktop --info | |
- name: Snapshot build deploy | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx' | |
run: | | |
./gradlew build publish | |
- name: Import GPG key | |
if: github.event_name == 'release' && github.repository_owner == 'libgdx' | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@1c6a9e9d3594f2d743f1b1dd7669ab0dfdffa922 | |
with: | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Release build deploy | |
if: github.event_name == 'release' && github.repository_owner == 'libgdx' | |
run: ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }} |