diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index 1820c280..7bcec241 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 80b798db..5077ffa4 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 f9cde019..cce3dfe1 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ "version": "2.17.1", "templateVersion": "2.17.1" }, + "wazuh": { + "version": "4.9.0", + "revision": "00" + }, "license": "Apache-2.0", "homepage": "https://github.com/opensearch-project/security-dashboards-plugin", "scripts": { @@ -57,4 +61,4 @@ "braces": "^3.0.3", "micromatch": "^4.0.8" } -} \ No newline at end of file +}