From a4ce009448359ada9df71b0332687976c242cfe1 Mon Sep 17 00:00:00 2001 From: Simon Beaudoin Date: Wed, 27 Aug 2025 20:43:04 -0700 Subject: [PATCH] Move the reusable workflow into a directory named reusable-workflows Signed-off-by: Simon Beaudoin --- README.md | 15 ++++++----- ...build-debian-package-reusable-workflow.yml | 2 ++ .../qcom-build-debian-package.yml | 26 +++++++++++++++++++ scripts/ppa_organizer.py | 6 ++--- 4 files changed, 40 insertions(+), 9 deletions(-) rename .github/workflows/qcom-build-debian-package-reusable-workflow.yml => reusable-workflows/build-debian-package-reusable-workflow.yml (99%) create mode 100644 reusable-workflows/qcom-build-debian-package.yml diff --git a/README.md b/README.md index 26d711c..cd1e841 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,18 @@ Overview -------- qcom-build-utils holds set of tools which to developers to build, test and debug platform and CI/CD utilities. -Branches --------- -main: Primary development branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch. - Features -------- -- ubuntu/build-utils scripts helps to assist build debian package, create system image and other tools related to ubuntu. +- scripts/ : Helper scripts to used in the reusable workflows +- reusable-workflows/ : Reusable workflows that other repo shall call -for more information, please refer to the README in each subdirectory. +Branches +-------- +main: Primary stable branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch. +development : Development happens on this branch, and gets merged back to main when the features are deemed stable +internal : This branch is the mirror of the internal version of the build-utils repo. It is there to keep a mirror, but the content + main and delvelopment has diverged substentially from it. It exists to that internal CI can use it, but should not be used + as a base for development License ------- diff --git a/.github/workflows/qcom-build-debian-package-reusable-workflow.yml b/reusable-workflows/build-debian-package-reusable-workflow.yml similarity index 99% rename from .github/workflows/qcom-build-debian-package-reusable-workflow.yml rename to reusable-workflows/build-debian-package-reusable-workflow.yml index de0cba2..aac3362 100644 --- a/.github/workflows/qcom-build-debian-package-reusable-workflow.yml +++ b/reusable-workflows/build-debian-package-reusable-workflow.yml @@ -1,3 +1,5 @@ +# This is the reusable workflow that gets invoked in other package repositories + name: Qualcomm Build Debian Package Reusable Workflow on: workflow_call: diff --git a/reusable-workflows/qcom-build-debian-package.yml b/reusable-workflows/qcom-build-debian-package.yml new file mode 100644 index 0000000..944b5c8 --- /dev/null +++ b/reusable-workflows/qcom-build-debian-package.yml @@ -0,0 +1,26 @@ +# This is the TEMPLATE workflow that needs to be copied in the .github/workflows folder +# of any new debian package repo. + +# If need be, adjust the branch/tag in the line that invokes the reusable workflow +# Also change the ref: to also match it + +name: Build Debian Package + +on: + pull_request_target: + branches: [ main ] + push: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + security-events: write + +jobs: + build: + uses: qualcomm-linux/qcom-build-utils/reusable-workflows/build-debian-package-reusable-workflow.yml@main + with: + ref: main + secrets: + ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }} \ No newline at end of file diff --git a/scripts/ppa_organizer.py b/scripts/ppa_organizer.py index 398cbb2..24751bd 100755 --- a/scripts/ppa_organizer.py +++ b/scripts/ppa_organizer.py @@ -44,7 +44,7 @@ This script will extract the 'canonical' package name (ie, without the major number in it, in this case its 1) and create a folder in the PPA structure for this package name, and copy over all the .deb/ddeb that correspondt to it. - + This operation will be done for all the 'canonical' package names because again, there can be multiple of this example package alongside one another @@ -81,7 +81,7 @@ def reorganize(build_dir : str, output_dir : str): # Create a list of all the packages (.deb, -dev.deb, -dbgsym.ddeb) files = os.listdir(build_dir) - + dsc_files = [f for f in files if f.endswith('.dsc') ] deb_files = [f for f in files if f.endswith('.deb') and "-dev" not in f] dev_files = [f for f in files if f.endswith('.deb') and "-dev" in f] @@ -113,7 +113,7 @@ def reorganize(build_dir : str, output_dir : str): for package_name in package_names: output_dir = os.path.join(output_dir, package_name) - + # Do not delete if the directory exists, it may very well contain the same package, but with older versions # We want to copy the newly built packages alongside the other versions create_new_directory(output_dir, delete_if_exists=False)