From b372463fbaebbc5c036afad35e4731578720f0a8 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 4 Apr 2026 10:54:52 +0200 Subject: [PATCH] fix(ci): Add workflow_call trigger to enable reusable workflows - build-packages.yml: Add workflow_call with secrets - build-image.yml: Add workflow_call with inputs, fix matrix for all event types - publish-packages.yml: Add workflow_call with inputs and secrets This fixes the release.yml workflow which was failing because it tried to call these workflows as reusable workflows without the workflow_call trigger defined. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/build-image.yml | 20 ++++++++++++++++++-- .github/workflows/build-packages.yml | 8 ++++++++ .github/workflows/publish-packages.yml | 14 ++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index b90693ae..26d20b11 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -1,6 +1,21 @@ name: Build SecuBox System Images on: + workflow_call: + inputs: + board: + description: 'Target board' + required: false + type: string + default: 'all' + size: + description: 'Image size' + required: false + type: string + default: '8G' + secrets: + GPG_PRIVATE_KEY: + required: false workflow_dispatch: inputs: board: @@ -33,7 +48,8 @@ jobs: strategy: fail-fast: false matrix: - board: ${{ github.event_name == 'push' && fromJson('["mochabin","espressobin-v7","espressobin-ultra","vm-x64"]') || (github.event.inputs.board == 'all' && fromJson('["mochabin","espressobin-v7","espressobin-ultra","vm-x64"]') || fromJson(format('["{0}"]', github.event.inputs.board))) }} + # Handle all event types: push (tags), workflow_call, workflow_dispatch + board: ${{ (github.event_name == 'push' || (inputs.board == 'all' || inputs.board == '')) && fromJson('["mochabin","espressobin-v7","espressobin-ultra","vm-x64"]') || (github.event.inputs.board == 'all' && fromJson('["mochabin","espressobin-v7","espressobin-ultra","vm-x64"]') || fromJson(format('["{0}"]', inputs.board || github.event.inputs.board || 'vm-x64'))) }} steps: - name: Checkout @@ -80,7 +96,7 @@ jobs: --board ${{ matrix.board }} \ --suite ${{ env.DEBIAN_SUITE }} \ --out output/ \ - --size ${{ github.event.inputs.size || '8G' }} + --size ${{ inputs.size || github.event.inputs.size || '8G' }} sudo chown -R $(id -u):$(id -g) output/ timeout-minutes: 90 diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 6b3448fb..20c064c5 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -6,6 +6,14 @@ on: tags: ['v*'] pull_request: branches: [main, master] + workflow_call: + secrets: + GPG_PRIVATE_KEY: + required: false + DEPLOY_SSH_KEY: + required: false + DEPLOY_KNOWN_HOSTS: + required: false workflow_dispatch: inputs: package: diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 8a9cbdc5..4d89bb58 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -3,6 +3,20 @@ name: Publish Packages on: + workflow_call: + inputs: + distribution: + description: 'Target distribution' + required: false + type: string + default: 'bookworm' + secrets: + GPG_PRIVATE_KEY: + required: true + DEPLOY_SSH_KEY: + required: true + DEPLOY_KNOWN_HOSTS: + required: true workflow_run: workflows: ["Build SecuBox .deb packages"] types: [completed]