Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New workflows names and triggers #713

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ name: Build and push Docker image
# This workflow runs when any of the following occur:
# - Run manually
# - Invoked from another workflow
# - Any change

on:
push:
workflow_dispatch:
inputs:
revision:
Expand Down Expand Up @@ -78,15 +81,15 @@ on:

jobs:
call-build-workflow:
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/5_builderpackage_wazuh-indexer.yml
with:
revision: ${{ inputs.revision }}
is_stage: ${{ inputs.is_stage }}
revision: ${{ inputs.revision || '0' }}
is_stage: ${{ inputs.is_stage || false }}
distribution: '[ "tar" ]'
architecture: '[ "x64" ]'
id: ${{ inputs.id }}
wazuh_plugins_ref: ${{ inputs.wazuh_plugins_ref }}
reporting_plugin_ref: ${{ inputs.reporting_plugin_ref }}
wazuh_plugins_ref: ${{ inputs.wazuh_plugins_ref || 'main' }}
reporting_plugin_ref: ${{ inputs.reporting_plugin_ref || 'main' }}
secrets: inherit

build-and-push-docker-image:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
run-name: Build ${{ inputs.distribution }} Wazuh Indexer on ${{ inputs.architecture }} | ${{ inputs.id }}
run-name: Build ${{ inputs.distribution || '[ "deb", "rpm" ]'}} Wazuh Indexer on ${{ inputs.architecture || '[ "x64", "arm64" ]' }} | ${{ inputs.id }}
name: Build packages (on demand)

# This workflow runs when any of the following occur:
# - Run manually
# - Invoked from another workflow
on:
push:
workflow_dispatch:
inputs:
revision:
Expand Down Expand Up @@ -125,14 +126,14 @@ jobs:
- id: setup
run: |
matrix=$(jq -cn \
--argjson distribution '${{ inputs.distribution }}' \
--argjson architecture '${{ inputs.architecture }}' \
--argjson distribution '${{ inputs.distribution || '[ "deb", "rpm" ]' }}' \
--argjson architecture '${{ inputs.architecture || '[ "x64", "arm64" ]' }}' \
'{distribution: $distribution, architecture: $architecture}'
)
echo "matrix=$matrix" >> $GITHUB_OUTPUT

build-wazuh-plugins:
if: ${{ inputs.wazuh_plugins_ref != '' }}
if: ${{ inputs.wazuh_plugins_ref != '' || github.event_name == 'push' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -146,7 +147,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: wazuh/wazuh-indexer-plugins
ref: ${{ inputs.wazuh_plugins_ref }}
ref: ${{ inputs.wazuh_plugins_ref || 'main'}}

- uses: actions/setup-java@v4
with:
Expand All @@ -158,11 +159,11 @@ jobs:

- name: Get version
id: version
run: echo "version=$(<VERSION)" >> "$GITHUB_OUTPUT"
run: echo "version=$(jq -r .version<VERSION.json)" >> "$GITHUB_OUTPUT"

- name: Build with Gradle
working-directory: ./plugins/${{ matrix.plugins }}
run: ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ inputs.revision }}
run: ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ inputs.revision || '0' }}

- run: ls -lR build/distributions
working-directory: ./plugins/${{ matrix.plugins }}
Expand All @@ -174,12 +175,12 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision }}.zip
path: "./plugins/${{ matrix.plugins }}/build/distributions/${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision }}.zip"
name: ${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision || '0' }}.zip
path: "./plugins/${{ matrix.plugins }}/build/distributions/${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision || '0' }}.zip"
if-no-files-found: error

build-reporting-plugin:
if: ${{ inputs.reporting_plugin_ref != '' }}
if: ${{ inputs.reporting_plugin_ref != '' || github.event_name == 'push' }}
runs-on: ubuntu-24.04
outputs:
hash: ${{ steps.save-hash.outputs.hash }}
Expand All @@ -189,7 +190,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: wazuh/wazuh-indexer-reporting
ref: ${{ inputs.reporting_plugin_ref }}
ref: ${{ inputs.reporting_plugin_ref || 'main'}}

- uses: actions/setup-java@v4
with:
Expand All @@ -201,10 +202,10 @@ jobs:

- name: Get version
id: version
run: echo "version=$(<VERSION)" >> "$GITHUB_OUTPUT"
run: echo "version=$(jq -r .version<VERSION.json)" >> "$GITHUB_OUTPUT"

- name: Build with Gradle
run: ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ inputs.revision }}
run: ./gradlew build -Dversion=${{ steps.version.outputs.version }} -Drevision=${{ inputs.revision || '0'}}

- run: ls -lR build/distributions

Expand All @@ -215,8 +216,8 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision }}.zip
path: build/distributions/${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision }}.zip
name: ${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision || '0' }}.zip
path: build/distributions/${{ env.plugin_name }}-${{ steps.version.outputs.version }}.${{ inputs.revision || '0'}}.zip
if-no-files-found: error

build:
Expand All @@ -233,13 +234,13 @@ jobs:
# Download plugins
- name: Download plugins
uses: actions/download-artifact@v4
if: ${{ inputs.wazuh_plugins_ref != '' || inputs.reporting_plugin_ref != ''}}
if: ${{ inputs.wazuh_plugins_ref != '' || inputs.reporting_plugin_ref != '' || github.event_name == 'push' }}
with:
path: ./artifacts/plugins
merge-multiple: true

- name: Display structure of downloaded files
if: ${{ inputs.wazuh_plugins_ref != '' || inputs.reporting_plugin_ref != ''}}
if: ${{ inputs.wazuh_plugins_ref != '' || inputs.reporting_plugin_ref != '' || github.event_name == 'push' }}
run: ls -lR ./artifacts/plugins

- uses: actions/setup-java@v4
Expand All @@ -254,16 +255,16 @@ jobs:
if: ${{ matrix.distribution == 'deb' }}
run: |
sudo bash build-scripts/provision.sh

- name: Run `baptizer.sh` (min)
run: |
name=$(bash build-scripts/baptizer.sh -m \
-a ${{ matrix.architecture }} \
-d ${{ matrix.distribution }} \
-r ${{ inputs.revision }} \
-r ${{ inputs.revision || '0'}} \
-l ${{ needs.build-wazuh-plugins.outputs.hash }} \
-e ${{ needs.build-reporting-plugin.outputs.hash }} \
${{ inputs.is_stage && '-x' || '' }} \
${{ inputs.is_stage && github.event_name != 'push' && '-x' || '' }} \
)
echo "name=$name" >> $GITHUB_OUTPUT
id: min_package
Expand All @@ -273,10 +274,10 @@ jobs:
name=$(bash build-scripts/baptizer.sh \
-a ${{ matrix.architecture }} \
-d ${{ matrix.distribution }} \
-r ${{ inputs.revision }} \
-r ${{ inputs.revision || '0'}} \
-l ${{ needs.build-wazuh-plugins.outputs.hash }} \
-e ${{ needs.build-reporting-plugin.outputs.hash }} \
${{ inputs.is_stage && '-x' || '' }} \
${{ inputs.is_stage && github.event_name != 'push' && '-x' || '' }} \
)
echo "name=$name" >> $GITHUB_OUTPUT
id: package
Expand All @@ -293,9 +294,7 @@ jobs:
bash build-scripts/assemble.sh \
-a ${{ matrix.architecture }} \
-d ${{ matrix.distribution }} \
-r ${{ inputs.revision }} \
-l ${{ needs.build-wazuh-plugins.outputs.hash }} \
-e ${{ needs.build-reporting-plugin.outputs.hash }}
-r ${{ inputs.revision || '0'}}

- name: Test RPM package
if: ${{ matrix.distribution == 'rpm' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name: "CodeQL"

on:
push:
schedule:
- cron: '00 8 * * 5'
workflow_dispatch:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/5_codequality_links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Link Checker
on:
push:

jobs:
linkchecker:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@master
with:
args: --accept=200,403,429 "./**/*.md" "./**/*.txt" --exclude "https://centos.pkgs.org/7/*"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Fail if there were link errors
run: exit ${{ steps.lychee.outputs.exit_code }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Version check
on:
push:
paths:
- "VERSION"
- "VERSION.json"

jobs:
check-version:
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/assemble.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/auto-release.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/backport.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/changelog_verifier.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/ci.yml

This file was deleted.

Loading
Loading