| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- name: 'Extract Sublevel and File Name'
- description: 'Reads Makefile sublevel and composes FILE_NAME'
- inputs:
- kernel_version:
- required: true
- type: string
- android_version:
- required: true
- type: string
- os_patch_level:
- required: true
- type: string
- variant:
- required: true
- type: string
- sublevel:
- required: true
- type: string
- outputs:
- file_name:
- value: ${{ steps.extract.outputs.file_name }}
- sublevel:
- value: ${{ steps.extract.outputs.sublevel }}
- runs:
- using: composite
- steps:
- - id: extract
- shell: bash
- run: |
- set -euo pipefail
- SUBLEVEL="${{ inputs.sublevel }}"
- if [ -f "${{ github.workspace }}/kernel/common/Makefile" ]; then
- EXTRACTED="$(grep '^SUBLEVEL = ' "${{ github.workspace }}/kernel/common/Makefile" | awk '{print $3}')"
- if [ "${{ inputs.os_patch_level }}" = "lts" ] && [ -n "$EXTRACTED" ]; then
- SUBLEVEL="$EXTRACTED"
- fi
- fi
- FILE_NAME="${{ inputs.kernel_version }}.${SUBLEVEL}-${{ inputs.android_version }}-${{ inputs.os_patch_level }}"
- # Append variant only when it's provided and not the default 'Normal'
- if [ -n "${{ inputs.variant }}" ] && [ "${{ inputs.variant }}" != "Normal" ]; then
- FILE_NAME="${FILE_NAME}-${{ inputs.variant }}"
- fi
- echo "SUBLEVEL=$SUBLEVEL" >> "$GITHUB_ENV"
- echo "FILE_NAME=$FILE_NAME" >> "$GITHUB_ENV"
- echo "file_name=$FILE_NAME" >> "$GITHUB_OUTPUT"
- echo "sublevel=$SUBLEVEL" >> "$GITHUB_OUTPUT"
|