From 11fb91b1b0eaad140ead27323f5d330493cf52e7 Mon Sep 17 00:00:00 2001 From: yenienserrano Date: Wed, 6 Dec 2023 12:48:37 +0100 Subject: [PATCH] Update Build manual Github action --- .github/workflows/dev-environment.yml | 8 +++++++- .github/workflows/manual-build.yml | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index b20ce7d91e..92aedc3fee 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -70,6 +70,7 @@ jobs: - name: Step 01 - Download the plugin's source code uses: actions/checkout@v3 with: + repository: wazuh/wazuh-dashboard-plugins ref: ${{ inputs.reference }} path: wazuh @@ -107,11 +108,16 @@ jobs: cd /home/node/kbn/plugins/${{ matrix.plugins.container_path }} && yarn && ${{ inputs.command }}; ' + - name: Get the plugin version + run: | + echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV + echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV + - name: Step 04 - Upload artifact to GitHub if: ${{ inputs.artifact_name && inputs.artifact_path }} uses: actions/upload-artifact@v3 with: - name: ${{ inputs.artifact_name }} + name: ${{ inputs.artifact_name }}_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip path: ${{ matrix.plugins.path }}/${{ inputs.artifact_path }} if-no-files-found: 'error' diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 32b03b0d14..859c9e105a 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -6,6 +6,13 @@ name: Manual build on: + workflow_call: + inputs: + reference: + required: true + type: string + default: master + description: Source code reference (branch, tag or commit SHA) workflow_dispatch: inputs: reference: @@ -20,7 +27,7 @@ jobs: name: Build app package uses: ./.github/workflows/dev-environment.yml with: - reference: ${{ github.event.inputs.reference }} + reference: ${{ inputs.reference }} command: 'yarn build' - artifact_name: 'wazuh-package' + artifact_name: 'wazuh-dashboard-plugins' secrets: inherit