Skip to content

Commit

Permalink
Update of the GitHub actions to create the packages (#33)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
yenienserrano authored and Tostti committed Apr 5, 2024
1 parent 101c80a commit bb51ae7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"version": "2.13.0",
"templateVersion": "2.13.0"
},
"wazuh": {
"version": "4.9.0",
"revision": "00"
},
"license": "Apache-2.0",
"homepage": "https://github.com/opensearch-project/security-dashboards-plugin",
"scripts": {
Expand Down Expand Up @@ -46,4 +50,4 @@
"glob-parent": "^5.1.2",
"debug": "^4.3.4"
}
}
}

0 comments on commit bb51ae7

Please sign in to comment.