build-mesa-host #54
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: build-mesa-host | |
on: | |
workflow_dispatch: | |
inputs: | |
gitref_to_build: | |
description: "gitref tag or hash to build" | |
default: master | |
required: true | |
type: string | |
target: | |
description: "targets to build" | |
default: all | |
required: true | |
type: choice | |
options: | |
- all | |
- aarch64 | |
- x86_64 | |
schedule: | |
# The times are specified in UTC | |
- cron: "15 13 * * *" | |
env: | |
debug: debug | |
ephemeral: ephemeral | |
jobs: | |
check_build_tools: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
name: Checkout LibreELEC/LibreELEC.tv and check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
hash: ${{ steps.latest_commit.outputs.hash }} | |
mesa: ${{ steps.tool_version.outputs.mesa }} | |
osver: ${{ steps.tool_version.outputs.osver }} | |
release_exists: ${{ steps.check_release.outputs.release_exists }} | |
release_doesnt_exists: ${{ steps.check_release.outputs.release_doesnt_exists }} | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: "mesa-reusable" | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.gitref_to_build || 'master' }} | |
fetch-depth: 2 | |
repository: "${{ github.repository_owner }}/LibreELEC.tv" | |
path: "LibreELEC.tv" | |
- id: latest_commit | |
name: print latest_commit of checked out LibreELEC/LibreELEC.tv | |
run: | | |
cd LibreELEC.tv | |
hash=$(git rev-parse HEAD) | |
echo "hash=${hash}" >> $GITHUB_OUTPUT | |
echo ${hash} | |
echo "mesa:host tools build - ${hash}" > build-log.txt | |
echo "=====================" >> build-log.txt | |
- id: tool_version | |
name: get versions of LibreELEC and mesa | |
run: | | |
cd LibreELEC.tv | |
tools/viewplan mesa:host >> build-log.txt | |
. config/options | |
echo "mesa=$(get_pkg_version mesa)" >> $GITHUB_OUTPUT | |
echo "osver=${OS_VERSION}" >> $GITHUB_OUTPUT | |
- id: check_release | |
name: Check for Release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
cd mesa-reusable | |
RELEASE_TAG=${{ steps.tool_version.outputs.osver }}-${{ steps.tool_version.outputs.mesa }} | |
if [ $(git tag -l "${RELEASE_TAG}") ]; then | |
echo "Tag ${RELEASE_TAG} exists" | |
set +e | |
gh release view $RELEASE_TAG | |
if [[ "$(gh release view $RELEASE_TAG 2>&1)" == "release not found" ]]; then | |
echo "Release ${RELEASE_TAG} not found." | |
echo "release_exists=false" >> $GITHUB_OUTPUT | |
echo "release_doesnt_exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "Release ${RELEASE_TAG} found." | |
echo "release_exists=true" >> $GITHUB_OUTPUT | |
echo "release_doesnt_exists=false" >> $GITHUB_OUTPUT | |
fi | |
else | |
echo "Tag ${RELEASE_TAG} does not exist" | |
echo "release_exists=false" >> $GITHUB_OUTPUT | |
echo "release_doesnt_exists=true" >> $GITHUB_OUTPUT | |
fi | |
- id: should_run | |
name: check if the release doesnt exist so as to create the release | |
run: | | |
echo "should_run=${{ steps.check_release.outputs.release_doesnt_exists }}" >> $GITHUB_OUTPUT | |
- id: create_release | |
name: release | |
if: ${{ steps.check_release.outputs.release_exists == 'false' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: false | |
prerelease: true | |
name: "reusable mesa:host tools for LibreELEC-${{ steps.tool_version.outputs.osver }} with mesa-${{ steps.tool_version.outputs.mesa }}" | |
tag_name: ${{ steps.tool_version.outputs.osver }}-${{ steps.tool_version.outputs.mesa }} | |
body_path: mesa-reusable/CHANGELOG.md | |
fail_on_unmatched_files: true | |
files: | | |
LibreELEC.tv/build-log.txt | |
# aarch64 (use Amlogic to do the build of mesa) | |
aarch64: | |
permissions: | |
contents: write | |
name: "aarch64" | |
# Only run if there is not a release | |
needs: check_build_tools | |
if: | | |
( needs.check_build_tools.outputs.should_run != 'false' ) | |
&& ( github.event.inputs.target == 'all' || github.event.inputs.target == 'aarch64' || github.event_name == 'schedule' ) | |
uses: ./.github/workflows/yml-build-mesa-host.yml | |
with: | |
runner: ubuntu-24.04-arm | |
debug: debug | |
ephemeral: ephemeral | |
upload_url: ${{ needs.check_build_tools.outputs.upload_url }} | |
buildcmd: "scripts/build_mt mesa:host" | |
gitref: ${{ github.event.inputs.gitref_to_build || 'master' }} | |
group: aarch64-mesa | |
project: Amlogic | |
arch: aarch64 | |
device: AMLGX | |
targetbuilddir: build.LibreELEC-AMLGX.aarch64-13.0-devel | |
version: ${{ needs.check_build_tools.outputs.osver }} | |
mesa: ${{ needs.check_build_tools.outputs.mesa }} | |
secrets: inherit | |
# x86_64 (use Amlogic to do the build of mesa) | |
x86_64: | |
permissions: | |
contents: write | |
name: "x86_64" | |
# Only run if there has been a commit in the last 24 hours | |
needs: check_build_tools | |
if: | | |
( needs.check_build_tools.outputs.should_run != 'false' ) | |
&& ( github.event.inputs.target == 'all' || github.event.inputs.target == 'x86_64' || github.event_name == 'schedule' ) | |
uses: ./.github/workflows/yml-build-mesa-host.yml | |
with: | |
runner: ubuntu-latest | |
debug: debug | |
ephemeral: ephemeral | |
upload_url: ${{ needs.check_build_tools.outputs.upload_url }} | |
buildcmd: "scripts/build_mt mesa:host" | |
gitref: ${{ github.event.inputs.gitref_to_build || 'master' }} | |
group: x86_64-mesa | |
project: Generic | |
arch: x86_64 | |
device: Generic | |
targetbuilddir: build.LibreELEC-Generic.x86_64-13.0-devel | |
version: ${{ needs.check_build_tools.outputs.osver }} | |
mesa: ${{ needs.check_build_tools.outputs.mesa }} | |
secrets: inherit |