centreon-plugins/.github/actions/package/action.yml

85 lines
2.4 KiB
YAML

name: package
description: Package module
inputs:
package_extension:
description: The package extension (deb or rpm)
required: true
distrib:
description: The package distrib (el8, bullseye...)
required: true
image_name:
description: The docker image name
required: true
script_name:
description: The packaging script name
plugins:
description: List of plugins to package
required: true
version:
description: The plugins version
required: true
release:
description: The release number
required: true
cache_key:
description: The package files cache key
required: true
sign:
description: Wether to sign the package or not
default: ""
registry_url:
description: Docker registry url
required: true
registry_username:
description: Docker registry username
required: true
registry_password:
description: Docker registry password
required: true
runs:
using: composite
steps:
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry_url }}
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}
- name: Package
uses: ./.github/actions/runner-docker
with:
script_name: ${{ inputs.script_name }}
image_name: ${{ inputs.image_name }}
image_version: latest
registry_url: ${{ inputs.registry_url }}
registry_username: ${{ inputs.registry_username }}
registry_password: ${{ inputs.registry_password }}
params: ${{ inputs.version }} ${{ inputs.release }} "${{ inputs.plugins }}"
- name: Sign
if: ${{ inputs.sign != '' && inputs.package_extension == 'rpm' }}
uses: ./.github/actions/runner-docker
with:
script_name: rpm-signing
image_name: rpm-signing
image_version: ubuntu
registry_url: ${{ inputs.registry_url }}
registry_username: ${{ inputs.registry_username }}
registry_password: ${{ inputs.registry_password }}
- name: Cache packaged files
uses: actions/cache@v3
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
- if: ${{ inputs.distrib == 'el8' }}
uses: actions/upload-artifact@v3
with:
name: packages-${{ inputs.distrib }}
path: ./*.${{ inputs.package_extension }}
retention-days: 1