Skip to content

Commit 02b72b8

Browse files
committed
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 <[email protected]> --------- Signed-off-by: Ian Yenien Serrano <[email protected]>
1 parent 4037896 commit 02b72b8

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.github/workflows/dev-environment.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- name: Step 01 - Download the plugin's source code
5050
uses: actions/checkout@v3
5151
with:
52+
repository: wazuh/wazuh-security-dashboards-plugin
5253
ref: ${{ inputs.reference }}
5354
path: wazuh-security-plugin
5455

@@ -74,12 +75,16 @@ jobs:
7475
yarn config set registry https://registry.yarnpkg.com;
7576
cd /home/node/kbn/plugins/wazuh-security-plugin && yarn && ${{ inputs.command }};
7677
'
78+
- name: Get the plugin version
79+
run: |
80+
echo "version=$(jq -r '.wazuh.version' $(pwd)/wazuh-security-plugin/package.json)" >> $GITHUB_ENV
81+
echo "revision=$(jq -r '.wazuh.revision' $(pwd)/wazuh-security-plugin/package.json)" >> $GITHUB_ENV
7782
7883
- name: Step 04 - Upload artifact to GitHub
7984
if: ${{ inputs.artifact_name && inputs.artifact_path }}
8085
uses: actions/upload-artifact@v3
8186
with:
82-
name: ${{ inputs.artifact_name }}
87+
name: ${{ inputs.artifact_name }}_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
8388
path: ${{ inputs.artifact_path }}
8489

8590
- name: Step 05 - Upload coverage results to GitHub

.github/workflows/manual-build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
name: Manual build
77

88
on:
9+
workflow_call:
10+
inputs:
11+
reference:
12+
required: true
13+
type: string
14+
description: Source code reference (branch, tag or commit SHA)
15+
default: 4.9.0
916
workflow_dispatch:
1017
inputs:
1118
reference:
@@ -20,8 +27,8 @@ jobs:
2027
name: Build app package
2128
uses: ./.github/workflows/dev-environment.yml
2229
with:
23-
reference: ${{ github.event.inputs.reference }}
30+
reference: ${{ inputs.reference }}
2431
command: 'yarn build'
25-
artifact_name: 'wazuh-security-dashboards-plugin-${{ github.event.inputs.reference }}.zip'
32+
artifact_name: 'wazuh-security-dashboards-plugin'
2633
artifact_path: './wazuh-security-plugin/build'
2734
secrets: inherit

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"version": "2.19.0",
77
"templateVersion": "2.19.0"
88
},
9+
"wazuh": {
10+
"version": "4.9.0",
11+
"revision": "00"
12+
},
913
"license": "Apache-2.0",
1014
"homepage": "https://github.com/opensearch-project/security-dashboards-plugin",
1115
"scripts": {
@@ -59,4 +63,4 @@
5963
"micromatch": "^4.0.8",
6064
"cross-spawn": "7.0.5"
6165
}
62-
}
66+
}

0 commit comments

Comments
 (0)