kebab (userdebug) | User: manid_reddy (1338252069) #132
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: AxionOS Builder | |
| run-name: '${{ inputs.DEVICE }} (${{ inputs.RELEASETYPE }}) | User: ${{ inputs.BUILD_USER }} (${{ inputs.BUILD_USER_ID }})' | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| DEVICE: | |
| description: 'Device Codename (e.g., walleye)' | |
| required: true | |
| default: 'walleye' | |
| RELEASETYPE: | |
| description: 'Build Release Type' | |
| required: true | |
| default: 'userdebug' | |
| type: choice | |
| options: | |
| - user | |
| - userdebug | |
| - eng | |
| FULLCLEAN: | |
| description: 'Run make clean (Wipe out)?' | |
| required: true | |
| default: 'No' | |
| type: choice | |
| options: | |
| - 'No' | |
| - 'Yes' | |
| GMS_VARIANT: | |
| description: 'GMS Variant' | |
| required: true | |
| default: 'GMS' | |
| type: choice | |
| options: | |
| - 'GMS' | |
| - 'PICO' | |
| - 'CORE' | |
| - 'VANILLA' | |
| UPLOAD_CDN: | |
| description: 'Upload to AxionOS CDN (R2)?' | |
| required: true | |
| default: 'No' | |
| type: choice | |
| options: | |
| - 'No' | |
| - 'Yes' | |
| LOCAL_MANIFEST_URL: | |
| description: 'URL to local_manifest.xml' | |
| required: false | |
| default: '' | |
| BUILD_USER: | |
| description: 'Triggered By (Username)' | |
| required: true | |
| default: 'GitHub-Action' | |
| BUILD_USER_ID: | |
| description: 'Triggered By (ID)' | |
| required: true | |
| default: '0' | |
| CHAT_ID: | |
| description: 'Telegram Chat ID for notifications' | |
| required: false | |
| default: '' | |
| TOPIC_ID: | |
| description: 'Telegram Topic ID (for Forums)' | |
| required: false | |
| default: '' | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| timeout-minutes: 360 | |
| env: | |
| DEVICE: ${{ inputs.DEVICE }} | |
| RELEASETYPE: ${{ inputs.RELEASETYPE }} | |
| FULLCLEAN: ${{ inputs.FULLCLEAN }} | |
| UPLOAD_CDN: ${{ inputs.UPLOAD_CDN }} | |
| GMS_VARIANT: ${{ inputs.GMS_VARIANT }} | |
| LOCAL_MANIFEST: ${{ inputs.LOCAL_MANIFEST_URL }} | |
| BUILD_USER: ${{ inputs.BUILD_USER }} | |
| BUILD_USER_ID: ${{ inputs.BUILD_USER_ID }} | |
| TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
| TELEGRAM_CHAT_ID: ${{ (inputs.CHAT_ID != 'none' && inputs.CHAT_ID) || secrets.TELEGRAM_CHAT_ID }} | |
| TOPIC_BUILDER: ${{ (inputs.TOPIC_ID != 'none' && inputs.TOPIC_ID) || secrets.TOPIC_BUILDER }} | |
| TOPIC_ERROR_LOGS: ${{ (inputs.TOPIC_ID != 'none' && secrets.TOPIC_ERROR_LOGS) || 'none' }} | |
| TOPIC_RELEASE_JSON: ${{ (inputs.TOPIC_ID != 'none' && secrets.TOPIC_RELEASE_JSON) || 'none' }} | |
| # R2 Credentials | |
| R2_ACCESS_KEY: ${{ secrets.R2_ACCESS_KEY }} | |
| R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }} | |
| R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }} | |
| R2_BUCKET: ${{ secrets.R2_BUCKET }} | |
| R2_CDN_DOMAIN: ${{ secrets.R2_CDN_DOMAIN }} | |
| AOSP_MANIFEST_URL: 'https://github.com/AxionAOSP/android.git' | |
| AOSP_MANIFEST_BRANCH: 'lineage-23.2' | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
| GITHUB_REPO_NAME: ${{ github.repository }} | |
| steps: | |
| - name: Runner Info | |
| run: | | |
| echo "Node version: $(node -v || echo 'Not installed')" | |
| echo "Git version: $(git --version || echo 'Not installed')" | |
| echo "Current user: $(whoami)" | |
| echo "Workspace: ${{ github.workspace }}" | |
| - name: Checkout Repo (Scripts) | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Setup Environment | |
| run: | | |
| echo "AOSP_SOURCE_DIR=$HOME/android/source" >> $GITHUB_ENV | |
| - name: Prepare Scripts | |
| run: | | |
| chmod +x builder/*.sh | |
| chmod +x builder/*.py | |
| rm -f *.log progress.txt .build_msg_id | |
| rm -f $AOSP_SOURCE_DIR/out/error.log | |
| mkdir -p $AOSP_SOURCE_DIR | |
| - name: Notify Start | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status started \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --upload-cdn "$UPLOAD_CDN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" | |
| - name: Sync Source | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status syncing \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --upload-cdn "$UPLOAD_CDN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| SYNC_CMD="export AOSP_MANIFEST_URL=\"$AOSP_MANIFEST_URL\"; export AOSP_MANIFEST_BRANCH=\"$AOSP_MANIFEST_BRANCH\"; cd $AOSP_SOURCE_DIR && ${{ github.workspace }}/builder/sync.sh \"$LOCAL_MANIFEST\"" | |
| ${{ github.workspace }}/builder/tmux_runner.sh \ | |
| "axion_build" \ | |
| "$SYNC_CMD" \ | |
| "${{ github.workspace }}/sync.log" | |
| - name: Build ROM | |
| id: build_rom | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status monitoring \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --upload-cdn "$UPLOAD_CDN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" & | |
| MONITOR_PID=$! | |
| BUILD_CMD="export GMS_VARIANT=\"$GMS_VARIANT\"; cd $AOSP_SOURCE_DIR && ${{ github.workspace }}/builder/build.sh \"$DEVICE\" \"$RELEASETYPE\" \"$FULLCLEAN\"" | |
| if ${{ github.workspace }}/builder/tmux_runner.sh \ | |
| "axion_build" \ | |
| "$BUILD_CMD" \ | |
| "${{ github.workspace }}/build.log" \ | |
| "${{ github.workspace }}/progress.txt"; then | |
| echo "BUILD_SUCCESS=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "BUILD_SUCCESS=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| fi | |
| kill $MONITOR_PID || true | |
| - name: Notify Success | |
| if: steps.build_rom.outputs.BUILD_SUCCESS == 'true' | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status success \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --upload-cdn "$UPLOAD_CDN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" | |
| - name: Notify Failure | |
| if: failure() | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status failure \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --upload-cdn "$UPLOAD_CDN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" | |
| - name: Force Kill Processes | |
| if: cancelled() | |
| run: | | |
| echo "Workflow cancelled. Ensuring processes are dead..." | |
| tmux send-keys -t axion_build C-c 2>/dev/null || true | |
| pkill -f "reporter.py --status monitoring" || true | |
| - name: Notify Cancelled | |
| if: cancelled() | |
| run: | | |
| python3 builder/reporter.py \ | |
| --run-id "${{ github.run_id }}" \ | |
| --status aborted \ | |
| --device "$DEVICE" \ | |
| --build-type "$RELEASETYPE" \ | |
| --release-status "No" \ | |
| --gms "$GMS_VARIANT" \ | |
| --full-clean "$FULLCLEAN" \ | |
| --user "$BUILD_USER" \ | |
| --chat-id "$TELEGRAM_CHAT_ID" \ | |
| --topic-builder "$TOPIC_BUILDER" \ | |
| --topic-error-logs "$TOPIC_ERROR_LOGS" \ | |
| --topic-release-json "$TOPIC_RELEASE_JSON" \ | |
| --token "$TELEGRAM_TOKEN" \ | |
| --build-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | |
| --source-dir "$AOSP_SOURCE_DIR" |