Compile StatiXOS for devices #22
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
# main.yml | |
# Default runner for 'releases' repository | |
name: Compile StatiXOS for devices | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
# Let the user decide whether to sync before compilation, or not | |
sync: | |
description: 'Sync repositories before building' | |
type: boolean | |
# Let the user decide whether to produce a clean build before compiling, or not | |
clean: | |
description: 'Produce a clean build' | |
type: boolean | |
# Make the user choice between a list of devices | |
device: | |
description: 'Choose device to build for:' | |
required: true | |
type: choice | |
options: | |
- 'Xiaomi POCO M6 Pro 5G / Redmi 12 5G / Redmi Note 12R' | |
- 'Xiaomi SM7125 family' | |
# Make the user choice between a list of build variant | |
variant: | |
description: 'Choose type of build variant:' | |
required: false | |
type: choice | |
options: | |
- 'Stable (user)' | |
- 'Debugging (userdebug)' | |
- 'Development (eng)' | |
# Make the user choice between a list of package types | |
package: | |
description: 'Choose type of package to build:' | |
required: false | |
type: choice | |
options: | |
- 'Recovery-flashable (otapackage)' | |
- 'Bootloader-flashable (updatepackage)' | |
jobs: | |
# Declare the 'sync' job | |
sync: | |
# Only execute if 'inputs.sync' is set to 'true' | |
if: ${{ inputs.sync }} | |
# Set our self-hosted runner's labels | |
runs-on: [self-hosted, linux, x64] | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Execute 'sync.sh' | |
- name: Start syncing StatiXOS | |
run: ${PWD}/tools/sync.sh | |
# Immediately cancel action if previous command failed | |
- if: failure() | |
run: | | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
# Declare the 'build' job | |
build: | |
# Set our self-hosted runner's labels | |
runs-on: [self-hosted, linux, x64] | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Export necessary enviroment tables | |
run: ${PWD}/tools/environment.sh | |
env: | |
CLEAN: ${{ inputs.clean }} | |
DEVICE: ${{ inputs.device }} | |
PACKAGE: ${{ inputs.package }} | |
BUILD_VARIANT: ${{ inputs.variant }} | |
# Execute 'sync.sh' | |
- name: Start compiling StatiXOS | |
run: | | |
# Unfortunately, we need to use 'run' in order to access '${HOME}'. | |
SCRIPT=${HOME}/stx/device/manifests/build.sh | |
# Execute the main script | |
${SCRIPT} ${DEVICE} | |
# Set commonly used environmental variables | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |