-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch to jnigen renaming, deploy to experimental
- Loading branch information
Showing
20 changed files
with
357 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,330 @@ | ||
name: Build and Publish | ||
|
||
on: | ||
push: | ||
branches: [ experimental ] | ||
|
||
jobs: | ||
|
||
natives-ios: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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: Build macOS natives | ||
run: | | ||
# See https://github.com/actions/virtual-environments/issues/2557 | ||
sudo mv /Library/Developer/CommandLineTools/SDKs/* /tmp | ||
sudo mv /Applications/Xcode.app /Applications/Xcode.app.bak | ||
sudo mv /Applications/Xcode_13.2.app /Applications/Xcode.app | ||
sudo xcode-select -switch /Applications/Xcode.app | ||
/usr/bin/xcodebuild -version | ||
./gradlew jniGen jnigenBuildIOS | ||
./backends/gdx-backend-robovm/build-objectal.sh | ||
- name: Pack artifacts | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" -o -name "*.xcframework" | grep "libs" > native-files-list | ||
zip -r natives-ios -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives-ios.zip | ||
path: natives-ios.zip | ||
|
||
natives-macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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: Build macOS natives | ||
run: | | ||
# See https://github.com/actions/virtual-environments/issues/2557 | ||
sudo mv /Library/Developer/CommandLineTools/SDKs/* /tmp | ||
sudo mv /Applications/Xcode.app /Applications/Xcode.app.bak | ||
sudo mv /Applications/Xcode_13.2.app /Applications/Xcode.app | ||
sudo xcode-select -switch /Applications/Xcode.app | ||
/usr/bin/xcodebuild -version | ||
./gradlew jniGen jnigenBuildMacOsX64 jnigenBuildMacOsXARM64 | ||
- name: Pack artifacts | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | ||
zip natives-macos -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives-macos.zip | ||
path: natives-macos.zip | ||
|
||
natives-linux: | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: ubuntu:18.04 | ||
steps: | ||
- name: Install dependencies into minimal dockerfile | ||
run: | | ||
# ubuntu dockerfile is very minimal (only 122 packages are installed) | ||
# need to install updated git (from official git ppa) | ||
apt update | ||
apt install -y software-properties-common | ||
add-apt-repository ppa:git-core/ppa -y | ||
# install dependencies expected by other steps | ||
apt update | ||
apt install -y git \ | ||
curl \ | ||
ca-certificates \ | ||
wget \ | ||
bzip2 \ | ||
zip \ | ||
unzip \ | ||
xz-utils \ | ||
maven \ | ||
ant sudo locales | ||
# set Locale to en_US.UTF-8 (avoids hang during compilation) | ||
locale-gen en_US.UTF-8 | ||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV | ||
echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV | ||
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV | ||
- uses: actions/checkout@v2 | ||
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 cross-compilation toolchains | ||
run: | | ||
sudo apt update | ||
sudo apt install -y --force-yes gcc g++ | ||
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 Linux natives | ||
run: | | ||
./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64 | ||
- name: Pack artifacts | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | ||
zip natives-linux -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives-linux.zip | ||
path: natives-linux.zip | ||
|
||
natives-windows: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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 cross-compilation toolchains | ||
run: | | ||
sudo apt update | ||
sudo apt install -y --force-yes mingw-w64 lib32z1 | ||
- name: Build Windows natives | ||
run: | | ||
./gradlew jniGen jnigenBuildWindows64 jnigenBuildWindows | ||
- name: Pack artifacts | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | ||
zip natives-windows -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives-windows.zip | ||
path: natives-windows.zip | ||
|
||
natives-android: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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: Build Android natives | ||
run: | | ||
export NDK_HOME=$ANDROID_NDK_HOME | ||
./gradlew jniGen jnigenBuildAndroid | ||
- name: Pack artifacts | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" | grep "libs" > native-files-list | ||
zip natives-android -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives-android.zip | ||
path: natives-android.zip | ||
|
||
pack-natives: | ||
runs-on: ubuntu-20.04 | ||
needs: [natives-macos, natives-linux, natives-windows, natives-ios, natives-android] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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 natives-ios artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives-ios.zip | ||
|
||
- name: Download natives-macos artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives-macos.zip | ||
|
||
- name: Download natives-linux artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives-linux.zip | ||
|
||
- name: Download natives-windows artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives-windows.zip | ||
|
||
- name: Download natives-android artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives-android.zip | ||
|
||
- name: Unpack natives | ||
run: | | ||
unzip -o natives-ios.zip | ||
unzip -o natives-macos.zip | ||
unzip -o natives-linux.zip | ||
unzip -o natives-windows.zip | ||
unzip -o natives-android.zip | ||
- name: Pack desktop natives | ||
run: | | ||
./gradlew jniGen | ||
ant -f gdx/jni/build.xml pack-natives | ||
ant -f extensions/gdx-box2d/gdx-box2d/jni/build.xml pack-natives | ||
ant -f extensions/gdx-freetype/jni/build.xml pack-natives | ||
ant -f extensions/gdx-bullet/jni/build.xml pack-natives | ||
- name: Pack natives | ||
run: | | ||
find . -name "*.a" -o -name "*.dll" -o -name "*.dylib" -o -name "*.so" -o -name "*-natives.jar" -o -name "*.xcframework" | grep "libs" > native-files-list | ||
zip -r natives -@ < native-files-list | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: natives.zip | ||
path: natives.zip | ||
|
||
publish: | ||
runs-on: ubuntu-20.04 | ||
needs: pack-natives | ||
env: | ||
ORG_GRADLE_PROJECT_MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
ORG_GRADLE_PROJECT_MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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 natives artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: natives.zip | ||
|
||
- name: Unpack natives | ||
run: | | ||
unzip -o natives.zip | ||
- name: Fetch external natives | ||
run: | | ||
./gradlew fetchExternalNatives | ||
- name: Snapshot build deploy | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/experimental' && github.repository_owner == 'libgdx' | ||
run: | | ||
./gradlew build publish |
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
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
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
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
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
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
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
Oops, something went wrong.