Skip to content

Commit

Permalink
Add github action build final wazuh dashboard package
Browse files Browse the repository at this point in the history
  • Loading branch information
yenienserrano committed Nov 29, 2023
1 parent 6fbcd38 commit f45a8d7
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build_wazuh_dashboard_with_plugins.yml
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

0 comments on commit f45a8d7

Please sign in to comment.