Skip to content

Build

Build #7

Workflow file for this run

# This is a basic workflow that is manually triggered
name: Build
on:
workflow_dispatch:
inputs:
VERSION:
description: 'Wazuh dashboard version'
required: true
default: '4.9.0'
REVISION:
description: 'Wazuh dashboard revision'
required: true
default: '1'
jobs:
build:
runs-on: ubuntu-latest
name: Build
defaults:
run:
working-directory: ./artifacts
strategy:
matrix:
DISTRIBUTION: [ tar.gz ]
ARCHITECTURE: [ x64, arm64 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ./artifacts
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './artifacts/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g [email protected]
yarn config set network-timeout 1000000 -g
- name: Configure Yarn Cache
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV
- name: Initialize Yarn Cache
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_LOCATION }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Get package version
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get artifact build name
run: |
echo "ARTIFACT_BUILD_NAME=wazuh-dashboard_${{ inputs.VERSION }}-${{ inputs.REVISION }}_${{ matrix.ARCHITECTURE }}_${{ github.sha }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV
- name: Run bootstrap
run: yarn osd bootstrap --allow-root
- name: Build linux-x64
if: matrix.ARCHITECTURE == 'x64'
run: yarn build-platform --linux --skip-os-packages --release
- name: Build linux-arm64
if: matrix.ARCHITECTURE == 'arm64'
run: yarn build-platform --linux-arm --skip-os-packages --release
- name: Rename artifact
run: mv /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ matrix.ARCHITECTURE }}.${{ matrix.DISTRIBUTION }} /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
- uses: actions/upload-artifact@v3
if: success()
with:
name: wazuh-dashboard_${{ inputs.VERSION }}-${{ inputs.REVISION }}_${{ matrix.ARCHITECTURE }}_${{ github.sha }}.${{ matrix.DISTRIBUTION }}
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
retention-days: 30