v1.71.2 #348
Workflow file for this run
This file contains hidden or 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: Release | |
| # This Workflow can be triggered two ways: | |
| # 1. A GitHub release is created (using the GitHub web UI). This triggers all of the platforms to | |
| # build and upload assets. | |
| # 2. A workflow_dispatch event is triggered from the GitHub web UI. This triggers a build for only | |
| # the platform specified in the dispatch event. | |
| env: | |
| RELEASE_TAG: ${{ github.event.inputs.release_tag }} | |
| # The default GITHUB_TOKEN does not have write permissions, which is needed to upload release | |
| # assets. | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| platform: | |
| description: 'Platform to build (desktop, web, android, ios, windows)' | |
| required: true | |
| default: 'desktop' | |
| release_tag: | |
| description: 'Release tag to build (e.g., v1.13.0)' | |
| required: true | |
| default: 'v1.13.0' | |
| release: | |
| types: [created] | |
| jobs: | |
| build-linux: | |
| name: build-linux | |
| runs-on: 'ubuntu-24.04-16core' | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'desktop' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: ./.github/actions/linux-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/linux && printf "y" | ./build.sh release | |
| cd ../.. | |
| mv out/filament-release-linux.tgz out/filament-${TAG}-linux.tgz | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| build-arm-linux: | |
| name: build-arm-linux | |
| runs-on: 'arm-ubuntu-24.04-16core' | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'desktop' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: ./.github/actions/linux-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/linux && printf "y" | ./build.sh release | |
| cd ../.. | |
| mv out/filament-release-linux.tgz out/filament-${TAG}-arm-linux.tgz | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| build-mac: | |
| name: build-mac | |
| runs-on: macos-14-xlarge | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'desktop' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: ./.github/actions/mac-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/mac && printf "y" | ./build.sh release | |
| cd ../.. | |
| mv out/filament-release-darwin.tgz out/filament-${TAG}-mac.tgz | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| build-web: | |
| name: build-web | |
| runs-on: 'arm-ubuntu-24.04-16core' | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'web' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: ./.github/actions/linux-prereq | |
| - uses: ./.github/actions/web-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/web && printf "y" | ./build.sh release | |
| cd ../.. | |
| mv out/filament-release-web.tgz out/filament-${TAG}-web.tgz | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| build-android: | |
| name: build-android | |
| runs-on: 'ubuntu-24.04-16core' | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'android' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - uses: ./.github/actions/linux-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/android && printf "y" | ./build.sh release armeabi-v7a,arm64-v8a,x86,x86_64 | |
| cd ../.. | |
| mv out/filament-android-release.aar out/filament-${TAG}-android.aar | |
| mv out/filamat-android-release.aar out/filamat-${TAG}-android.aar | |
| mv out/gltfio-android-release.aar out/gltfio-${TAG}-android.aar | |
| mv out/filament-utils-android-release.aar out/filament-utils-${TAG}-android.aar | |
| mv out/filament-android-release-linux.tgz out/filament-${TAG}-android-native.tgz | |
| - name: Sign sample-gltf-viewer | |
| run: | | |
| echo "${APK_KEYSTORE_BASE64}" > filament.jks.base64 | |
| base64 --decode -i filament.jks.base64 > filament.jks | |
| BUILD_TOOLS_VERSION=$(ls ${ANDROID_HOME}/build-tools | sort -V | tail -n 1) | |
| APKSIGNER=${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/apksigner | |
| IN_FILE="out/sample-gltf-viewer-release.apk" | |
| OUT_FILE="out/filament-gltf-viewer-${TAG}-android.apk" | |
| ${APKSIGNER} sign --ks filament.jks --key-pass=pass:${APK_KEYSTORE_PASS} --ks-pass=pass:${APK_KEYSTORE_PASS} --in ${IN_FILE} --out ${OUT_FILE} | |
| rm "${IN_FILE}" | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| APK_KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }} | |
| APK_KEYSTORE_PASS: ${{ secrets.APK_KEYSTORE_PASS }} | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create(['out/*.aar', 'out/*.apk', 'out/*.tgz'].join('\n')); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| sonatype-publish: | |
| name: sonatype-publish | |
| runs-on: 'ubuntu-24.04-16core' | |
| # Depends on the the Android build for the Android binaries. | |
| # Depends on the Mac, Linux, and Windows builds for host tools. | |
| needs: [build-mac, build-linux, build-windows, build-android] | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'android' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - uses: ./.github/actions/linux-prereq | |
| - name: Download Android Release | |
| run: | | |
| gh release download ${TAG} \ | |
| --repo ${{ github.repository }} \ | |
| --pattern 'filament-*-android-native.tgz' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| - name: Unzip Android Release | |
| run: | | |
| mkdir -p out/android-release | |
| tar -xzvf filament-${TAG}-android-native.tgz -C out/android-release/ | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| - name: Publish To Sonatype | |
| run: | | |
| cd android | |
| ./gradlew publishToSonatype closeSonatypeStagingRepository | |
| env: | |
| ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
| ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_SIGNING_PASSWORD }} | |
| build-ios: | |
| name: build-ios | |
| runs-on: macos-14-xlarge | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'ios' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - uses: ./.github/actions/mac-prereq | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| cd build/ios && printf "y" | ./build.sh release | |
| cd ../.. | |
| mv out/filament-release-ios.tgz out/filament-${TAG}-ios.tgz | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); | |
| build-windows: | |
| name: build-windows | |
| runs-on: windows-2022-32core | |
| if: github.event_name == 'release' || github.event.inputs.platform == 'windows' | |
| steps: | |
| - name: Decide Git ref | |
| id: git_ref | |
| run: | | |
| REF=${RELEASE_TAG:-${GITHUB_REF}} | |
| TAG=${REF##*/} | |
| echo "ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - uses: actions/checkout@v4.1.6 | |
| with: | |
| ref: ${{ steps.git_ref.outputs.ref }} | |
| - name: Run build script | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| run: | | |
| @REMARK 'call' is required to ensure control returns to this script after the batch file finishes. | |
| call build\windows\build-github.bat release | |
| echo on | |
| move out\filament-windows.tgz out\filament-%TAG%-windows.tgz | |
| shell: cmd | |
| - uses: actions/github-script@v6 | |
| env: | |
| TAG: ${{ steps.git_ref.outputs.tag }} | |
| with: | |
| script: | | |
| const upload = require('./build/common/upload-release-assets'); | |
| const { TAG } = process.env; | |
| const globber = await glob.create('out/*.tgz'); | |
| await upload({ github, context }, await globber.glob(), TAG); |