forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action build final wazuh dashboard package
- Loading branch information
1 parent
6fbcd38
commit f45a8d7
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Build final packages | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
WAZUH_DASHBOARD_PACKAGE_X64: | ||
description: 'Wazuh dashboard package x64' | ||
required: true | ||
default: '' | ||
WAZUH_PLUGINS_PACKAGES: | ||
description: 'Wazuh plugins packages' | ||
required: true | ||
default: '' | ||
WAZUH_SECURITY_PLUGIN_PACKAGES: | ||
description: 'Wazuh security packages' | ||
required: true | ||
default: '' | ||
jobs: | ||
Build-final-packages: | ||
runs-on: ubuntu-latest | ||
name: Generate final packages | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
DISTRIBUTION: [ tar.gz, deb, rpm ] | ||
# TODO: Add arm64 support | ||
ARCHITECTURE: [ x64 ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Setup variables | ||
run: | | ||
echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV | ||
echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV | ||
echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV | ||
- name: Build the Wazuh Base x64 | ||
run: | | ||
bash ${{ env.CURRENT_DIR }}/dev-tools/build-packages/base/generate_base.sh \ | ||
-v ${{ env.VERSION }} \ | ||
-r ${{ env.REVISION }} \ | ||
-a ${{ inputs.WAZUH_PLUGINS_PACKAGES }} \ | ||
-s ${{ inputs.WAZUH_SECURITY_PLUGIN_PACKAGES }} \ | ||
-b ${{ inputs.WAZUH_DASHBOARD_PACKAGE_X64 }} | ||
- name: Get base package name | ||
run: | | ||
echo "WAZUH_BASE=$(ls ${{ env.CURRENT_DIR }}/dev-tools/build-packages/base/output)" >> $GITHUB_ENV | ||
- name: Build the package | ||
if: matrix.DISTRIBUTION != 'tar.gz' | ||
run: | | ||
bash ${{ env.CURRENT_DIR }}/dev-tools/build-packages/${{ matrix.DISTRIBUTION }}/launcher.sh \ | ||
-p file://${{ env.CURRENT_DIR }}/dev-tools/build-packages/base/output/${{env.WAZUH_BASE}} \ | ||
-v ${{ env.VERSION }} \ | ||
-r ${{ env.REVISION }} | ||
- name: Get packages name | ||
if: matrix.DISTRIBUTION != 'tar.gz' | ||
run: | | ||
echo "WAZUH_PACKAGES=$(find ${{ env.CURRENT_DIR }}/dev-tools/build-packages/${{ matrix.DISTRIBUTION }}/output -name "*.${{ matrix.DISTRIBUTION }}")" >> $GITHUB_ENV | ||
echo "WAZUH_PACKAGE_NAME=wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_${{ matrix.ARCHITECTURE }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV | ||
- name: Rename ${{ matrix.DISTRIBUTION }} packages | ||
if: matrix.DISTRIBUTION != 'tar.gz' | ||
run: | | ||
mv ${{ env.WAZUH_PACKAGES }} ${{ env.CURRENT_DIR }}/dev-tools/build-packages/${{ matrix.DISTRIBUTION }}/output/${{ env.WAZUH_PACKAGE_NAME }} | ||
- name: Upload packages ${{ matrix.DISTRIBUTION }} | ||
uses: actions/upload-artifact@v3 | ||
if: success() && matrix.DISTRIBUTION != 'tar.gz' | ||
with: | ||
name: Wazuh_dashboard_package_${{ matrix.ARCHITECTURE }}_${{ matrix.DISTRIBUTION }} | ||
path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/${{ matrix.DISTRIBUTION }}/output/${{ env.WAZUH_PACKAGE_NAME }} | ||
retention-days: 30 | ||
|
||
|
||
- name: Upload packages tar.gz | ||
uses: actions/upload-artifact@v3 | ||
if: success() && matrix.DISTRIBUTION == 'tar.gz' | ||
with: | ||
name: ${{env.WAZUH_BASE}} | ||
path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/base/output/${{env.WAZUH_BASE}} | ||
retention-days: 30 |