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-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: '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 cd out/android-release/filament tar -czf ../../filament-${TAG}-android-native.tgz . cd ../../.. - 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); 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: | 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);