Skip to content

Commit

Permalink
Improve CI for Android artifacts (KhronosGroup#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik authored Nov 18, 2022
1 parent 3637ac3 commit f5e84ab
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/android-helloxr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ jobs:
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3.6.0
with:
java-version: "11"
distribution: "adopt"
distribution: "temurin"
cache: gradle

# HelloXR OpenGLES version
- name: Build HelloXR OpenGLES for Android
run: |
cd src/tests/hello_xr
./gradlew assembleOpenGLESDebug
uses: gradle/gradle-build-action@v2
with:
arguments: assembleOpenGLESDebug
build-root-directory: src/tests/hello_xr
- name: Upload HelloXR OpenGLES Android
uses: actions/upload-artifact@v2
with:
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
- uses: actions/checkout@v2
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3

- name: set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3.6.0
with:
java-version: "11"
distribution: "adopt"
distribution: "temurin"
cache: gradle

- name: Build, sign, and publish AAR
Expand Down Expand Up @@ -54,17 +55,18 @@ jobs:
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
- name: set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3.6.0
with:
java-version: "11"
distribution: "adopt"
distribution: "temurin"
cache: gradle

# HelloXR OpenGLES version
- name: Build HelloXR OpenGLES for Android
run: |
cd src/tests/hello_xr
./gradlew assembleOpenGLESRelease
uses: gradle/gradle-build-action@v2
with:
arguments: assembleOpenGLESRelease
build-root-directory: src/tests/hello_xr
- name: Sign HelloXR OpenGLES Android release
uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407
id: sign_gles
Expand All @@ -76,17 +78,24 @@ jobs:
keyPassword: ${{ secrets.APK_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.3"

- name: Rename APK
env:
SIGNED_FILE: ${{ steps.sign_gles.outputs.signedReleaseFile }}
run: mv $SIGNED_FILE HelloXR_OpenGLES.apk
- name: Upload HelloXR OpenGLES Android
uses: actions/upload-artifact@v2
with:
name: HelloXR OpenGLES Android
path: ${{ steps.sign_gles.outputs.signedReleaseFile }}
path: HelloXR_OpenGLES.apk

# HelloXR Vulkan version
- name: Build HelloXR Vulkan for Android
run: |
cd src/tests/hello_xr
./gradlew assembleVulkanRelease
uses: gradle/gradle-build-action@v2
with:
arguments: assembleVulkanRelease
build-root-directory: src/tests/hello_xr

- name: Sign HelloXR Vulkan Android release
uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407
id: sign_vulkan
Expand All @@ -98,8 +107,20 @@ jobs:
keyPassword: ${{ secrets.APK_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.3"

- name: Rename APK
env:
SIGNED_FILE: ${{ steps.sign_vulkan.outputs.signedReleaseFile }}
run: mv $SIGNED_FILE HelloXR_Vulkan.apk

- name: Upload HelloXR Vulkan Android
uses: actions/upload-artifact@v2
with:
name: HelloXR Vulkan Android
path: ${{ steps.sign_vulkan.outputs.signedReleaseFile }}
path: HelloXR_Vulkan.apk

- name: Release
if: startsWith(github.ref, 'refs/tags/release-')
uses: softprops/action-gh-release@v1
with:
files: HelloXR_*.apk
6 changes: 4 additions & 2 deletions .github/workflows/android-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ jobs:
- uses: actions/checkout@v2
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3

- name: set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3.6.0
with:
java-version: "11"
distribution: "adopt"
distribution: "temurin"
cache: gradle

- name: Build, sign, and publish AAR
run: ./maintainer-scripts/build-and-publish-aar-snapshot.sh
env:
Expand Down

0 comments on commit f5e84ab

Please sign in to comment.