From 520cbd7d25240e5250f6ab9efbceab83daa9e668 Mon Sep 17 00:00:00 2001 From: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:50:38 +0100 Subject: [PATCH] Update of the GitHub actions to create the packages (#33) * Update Build manual Github action * Add wazuh version in package.json * Update package.json Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> --------- Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> --- .github/workflows/dev-environment.yml | 7 ++++++- .github/workflows/manual-build.yml | 11 +++++++++-- package.json | 6 +++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index 1820c280f..7bcec2419 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -49,6 +49,7 @@ jobs: - name: Step 01 - Download the plugin's source code uses: actions/checkout@v3 with: + repository: wazuh/wazuh-security-dashboards-plugin ref: ${{ inputs.reference }} path: wazuh-security-plugin @@ -74,12 +75,16 @@ jobs: yarn config set registry https://registry.yarnpkg.com; cd /home/node/kbn/plugins/wazuh-security-plugin && yarn && ${{ inputs.command }}; ' + - name: Get the plugin version + run: | + echo "version=$(jq -r '.wazuh.version' $(pwd)/wazuh-security-plugin/package.json)" >> $GITHUB_ENV + echo "revision=$(jq -r '.wazuh.revision' $(pwd)/wazuh-security-plugin/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: ${{ inputs.artifact_path }} - name: Step 05 - Upload coverage results to GitHub diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 80b798dbd..5077ffa4d 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 + description: Source code reference (branch, tag or commit SHA) + default: 4.9.0 workflow_dispatch: inputs: reference: @@ -20,8 +27,8 @@ 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-security-dashboards-plugin-${{ github.event.inputs.reference }}.zip' + artifact_name: 'wazuh-security-dashboards-plugin' artifact_path: './wazuh-security-plugin/build' secrets: inherit \ No newline at end of file diff --git a/package.json b/package.json index 988623db6..e59623a21 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ "version": "2.15.0", "templateVersion": "2.15.0" }, + "wazuh": { + "version": "4.9.0", + "revision": "00" + }, "license": "Apache-2.0", "homepage": "https://github.com/opensearch-project/security-dashboards-plugin", "scripts": { @@ -53,4 +57,4 @@ "ejs": "^3.1.10", "express": "^4.19.2" } -} \ No newline at end of file +}