centreon-plugins/.github/actions/deb-delivery/action.yml

57 lines
1.5 KiB
YAML

name: "deb-delivery"
description: "Deliver DEB packages"
inputs:
module_name:
description: "The package module name"
required: true
distrib:
description: "The distribution used for packaging"
required: true
cache_key:
description: "The cached package key"
required: true
stability:
description: "The package stability (stable, testing, unstable)"
required: true
artifactory_token:
description: "token for artifactory"
required: true
runs:
using: "composite"
steps:
- name: Remove previously delivered DEBs
run: rm -f ./*.deb
shell: bash
- name: Use cache DEB files
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ./*.deb
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true
- uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
- name: Publish DEBs to artifactory
run: |
FILES="*.deb"
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
REPO_PREFIX="ubuntu"
else
REPO_PREFIX="apt"
fi
for FILE in $FILES; do
echo "[DEBUG] - File: $FILE"
ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1)
jf rt upload "$FILE" "${REPO_PREFIX}-plugins-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
done
shell: bash