Add script to get the version of OpenSearch #98
Workflow file for this run
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
name: Build packages | |
# This workflow runs when any of the following occur: | |
# - Run manually | |
on: | |
push: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
- "ci/*" | |
workflow_dispatch: | |
inputs: | |
revision: | |
description: "Revision" | |
type: string | |
required: true | |
default: "1" | |
upload: | |
description: "Upload ?" | |
type: bool | |
default: false | |
# ========================== | |
# Bibliography | |
# ========================== | |
# | |
# * Reusable workflows: limitations | |
# | https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations | |
# * Using matrix in reusable workflows: | |
# | https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-a-matrix-strategy-with-a-reusable-workflow | |
# * Reading input from the called workflow | |
# | https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs | |
# * Ternary operator | |
# | https://docs.github.com/en/actions/learn-github-actions/expressions#example | |
jobs: | |
version: | |
uses: ./.github/workflows/r_version.yml | |
commit_sha: | |
uses: ./.github/workflows/r_commit_sha.yml | |
build: | |
needs: [version, commit_sha] | |
strategy: | |
matrix: | |
distribution: [tar, rpm, deb] | |
architecture: [x64, arm64] | |
uses: ./.github/workflows/r_build.yml | |
with: | |
architecture: ${{ matrix.architecture }} | |
distribution: ${{ matrix.distribution }} | |
revision: ${{ github.event_name == 'push' && '1' || inputs.revision }} | |
name: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} | |
assemble: | |
needs: [version, commit_sha, build] | |
strategy: | |
matrix: | |
distribution: [tar, rpm, deb] | |
architecture: [x64, arm64] | |
exclude: | |
# skip arm64 until we have arm runners | |
- architecture: arm64 | |
- distribution: tar | |
uses: ./.github/workflows/r_assemble.yml | |
with: | |
architecture: ${{ matrix.architecture }} | |
distribution: ${{ matrix.distribution }} | |
min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} | |
test: | |
needs: [version, commit_sha, assemble] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [{ suffix: "amd64", ext: "deb" }, { suffix: "x86_64", ext: "rpm" }] | |
uses: ./.github/workflows/r_test.yml | |
with: | |
package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}_${{ matrix.os.suffix }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.os.ext }} | |
upload: | |
needs: [version, commit_sha, test] | |
# Upload only on 'workflow_dispatch' event and if 'upload=true' | |
if: ${{ github.event_name == 'push' && inputs.upload }} | |
uses: ./.github/workflows/r_upload.yml | |
with: | |
package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}_${{ matrix.os.suffix }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.os.ext }} | |
secrets: inherit |