Packages - Build Wazuh agent macOS packages - arm64 #5
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
run-name: Packages - Build Wazuh agent macOS packages - ${{ inputs.architecture }}${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} ${{ inputs.id }} | |
name: Build Wazuh agent macOS packages | |
on: | |
workflow_dispatch: | |
inputs: | |
architecture: | |
type: choice | |
description: Package architecture [intel64, arm64]. | |
options: | |
- intel64 | |
- arm64 | |
required: true | |
revision: | |
type: string | |
description: | | |
Package revision (name and metadata). | |
Default is '0'. | |
required: false | |
default: '0' | |
is_stage: | |
type: boolean | |
description: | | |
Set production nomenclature if true. | |
Default is 'false'. | |
required: false | |
checksum: | |
type: boolean | |
description: | | |
Generate package checksum. | |
Default is 'false'. | |
required: false | |
source_reference: | |
type: string | |
description: | | |
Branch/tag of wazuh/wazuh-agent to generate packages. | |
required: true | |
id: | |
type: string | |
description: | | |
ID used to identify the workflow uniquely. | |
required: false | |
workflow_call: | |
inputs: | |
architecture: | |
type: string | |
required: true | |
revision: | |
type: string | |
required: false | |
is_stage: | |
type: boolean | |
required: false | |
checksum: | |
type: boolean | |
required: false | |
source_reference: | |
type: string | |
required: true | |
id: | |
type: string | |
required: false | |
jobs: | |
build-binaries-agent-macos-packages: | |
uses: wazuh/wazuh-agent/.github/workflows/macos_compile_repository.yml@enhancement/137-pkg-build-trigger | |
with: | |
architecture: ${{ inputs.architecture }} | |
source_reference: ${{ inputs.source_reference }} | |
id: ${{ inputs.id }} | |
build-package-agent-macos-packages: | |
needs: build-binaries-agent-macos-packages | |
runs-on: macos-14 | |
timeout-minutes: 50 | |
name: Build macOS wazuh-agent package - ${{ inputs.architecture }}${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} | |
steps: | |
- name: Download wazuh-agent-binaries.zip | |
uses: actions/download-artifact@v4 | |
with: | |
name: wazuh-agent-binaries-${{ inputs.architecture }} | |
- name: Set vars to build macOS package | |
run: | | |
FLAGS="-a ${{ inputs.architecture }} -j $(sysctl -n hw.ncpu) -r ${{ inputs.revision }} -s /tmp --verbose " | |
if [ "${{ inputs.is_stage }}" == "true" ]; then FLAGS+="--is_stage "; fi | |
if [ "${{ inputs.checksum }}" == "true" ]; then FLAGS+="--checksum "; fi | |
echo "FLAGS=$FLAGS" >> $GITHUB_ENV | |
- name: Build macOS package | |
run: | | |
sudo unzip wazuh-agent-binaries-${{ inputs.architecture }}.zip -d / | |
bash packages/macos/generate_wazuh_packages.sh -i | |
echo 'generate_wazuh_packages.sh ${{ env.FLAGS }}' | |
sudo bash packages/macos/generate_wazuh_packages.sh ${{ env.FLAGS }} | |
- name: Zip package | |
run: | | |
sudo zip -r /tmp/wazuh-agent-package-${{ inputs.architecture }}.zip /tmp/*.pkg* -j | |
- name: Upload wazuh agent package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wazuh-agent-package-${{ inputs.architecture }} | |
path: /tmp/wazuh-agent-package-${{ inputs.architecture }}.zip | |
test-package-agent-macos-packages: | |
needs: build-package-agent-macos-packages | |
uses: wazuh/wazuh-agent/.github/workflows/macos_test_package.yml@enhancement/137-pkg-build-trigger | |
with: | |
architecture: ${{ inputs.architecture }} | |
checksum: ${{ inputs.checksum }} | |
upload_to_s3: ${{ inputs.upload_to_s3 }} | |
id: ${{ inputs.id }} |