Skip to content

Generate Ubuntu Packages #181

Generate Ubuntu Packages

Generate Ubuntu Packages #181

---
name: pre_merge_ubuntu
run-name: Generate Ubuntu Packages
on:
workflow_dispatch:
inputs:
qcom-build-utils-pr-number:
description: qcom-build-utils-pr-number (keep empty to use `latest` branch)
required: false
type: string
pr:
description: Pull request number
type: string
required: false
sha:
description: Head sha of the PR
type: string
required: false
ref:
description: Target branch
type: string
required: false
repo:
description: Target repository
type: string
required: false
jobs:
init-status:
name: Initialize Status
runs-on: ubuntu-latest
steps:
- name: Set Status
uses: qualcomm-linux/kernel-config/.github/actions/workflow_status@main
with:
sha: ${{ github.event.inputs.sha || github.sha }}
action_mode: start
check_name: "Ubuntu Package Generation"
repo: ${{ github.event.inputs.repo || github.repository }}
GH_TOKEN: ${{ secrets.PAT }}
init:
name: Initialize Workflow
needs: init-status
runs-on: ubuntu-latest
outputs:
commit_sha: ${{ steps.get_sha.outputs.commit_sha }}
steps:
- name: Checkout qcom-build-utils
uses: actions/checkout@v4
with:
repository: qualcomm-linux/qcom-build-utils
ref: refs/tags/v2.0.0
token: ${{ secrets.PAT }}
- name: Get commit sha
id: get_sha
run: |
echo "${{ secrets.PAT }}" | gh auth login --with-token
if [ -n "${{ github.event.inputs.qcom-build-utils-pr-number }}" ]; then
# fetch latest commit hash from the PR branch
commit_sha=$(gh pr view ${{ github.event.inputs.qcom-build-utils-pr-number }} --json commits --jq '.commits[-1].oid')
echo "commit_sha=${commit_sha}" >> "$GITHUB_OUTPUT"
else
# use the latest commit hash from the checkout Tag
commit_sha=$(git rev-parse HEAD)
echo "commit_sha=${commit_sha}" >> "$GITHUB_OUTPUT"
fi
echo "commit_sha=${commit_sha}"
- name: Update Summary
run: |
echo "## Ubuntu Package Generation" >> $GITHUB_STEP_SUMMARY
echo "- Pull Request Number: \`${{ github.event.inputs.pr || 'N/A' }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Head Commit SHA: \`${{ github.event.inputs.sha || 'N/A' }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Target Branch: \`${{ github.event.inputs.ref || 'N/A' }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Target Repository: \`${{ github.event.inputs.repo || 'N/A' }}\`" >> $GITHUB_STEP_SUMMARY
loading:
name: Load Parameters
needs: init-status
uses: qualcomm-linux/kernel-config/.github/workflows/loading.yml@main
secrets: inherit
generate_debians:
name: Generate Debian Packages
needs: [init-status, init, loading]
uses: qualcomm-linux/kernel-config/.github/workflows/ubuntu-package-generation.yml@main
secrets: inherit
with:
pr: ${{ github.event.inputs.pr || '' }}
ref: ${{ github.event.inputs.ref || 'qcom-next' }}
build_utils_ref: ${{ needs.init.outputs.commit_sha }}
repo: ${{ github.event.inputs.repo || 'qualcomm-linux-stg/kernel' }}
build_matrix: ${{ needs.loading.outputs.ubuntu_matrix }}
check_run:
runs-on: ubuntu-latest
needs: [init-status, loading, generate_debians]
steps:
- name: Post check run
uses: qualcomm-linux/kernel-config/.github/actions/check_run@main
with:
sha: ${{ inputs.sha }}
repo: ${{ inputs.repo }}
s3_location: ${{ needs.generate_debians.outputs.artifacts_location }}
workflow_name: " for ${{ github.workflow }}"
APPID: ${{ secrets.APPID }}
PVK: ${{ secrets.PVK }}
final-status:
name: Finalize Status
if: always()
runs-on: ubuntu-latest
needs: [generate_debians, check_run]
steps:
- name: Set final status
uses: qualcomm-linux/kernel-config/.github/actions/workflow_status@main
with:
sha: ${{ github.event.inputs.sha || github.sha }}
action_mode: ${{ needs.generate_debians.result }}
check_name: "Ubuntu Package Generation"
repo: ${{ github.event.inputs.repo || github.repository }}
GH_TOKEN: ${{ secrets.PAT }}