Skip to content

Commit

Permalink
general cleanup, merge of package&package-nfpm
Browse files Browse the repository at this point in the history
  • Loading branch information
mushroomempires committed Jan 29, 2024
1 parent 12ee977 commit 8451fdc
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 117 deletions.
35 changes: 23 additions & 12 deletions .github/actions/package-nfpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
distrib:
description: The package distrib
required: true
version:
description: The package version ([major_version].[minor_version])
required: false
major_version:
description: The major version
required: false
Expand Down Expand Up @@ -62,8 +65,15 @@ runs:
RPM_GPG_SIGNING_KEY_ID: ${{ inputs.rpm_gpg_signing_key_id }}
RPM_GPG_SIGNING_PASSPHRASE: ${{ inputs.rpm_gpg_signing_passphrase }}
run: |
export MAJOR_VERSION="${{ inputs.major_version }}"
export VERSION="${{ inputs.major_version }}.${{ inputs.minor_version }}"
if [ -z ${{ inputs.version }} ]; then
export VERSION="${{ inputs.major_version }}.${{ inputs.minor_version }}"
export MAJOR_VERSION="${{ inputs.major_version }}"
export MINOR_VERSION="${{ inputs.minor_version }}"
elif [ -z ${{ inputs.major_version }} ];
export VERSION="${{ inputs.version }}"
export MAJOR_VERSION=$( echo $MAJOR_VERSION | cut -d "-" -f1 )
export MINOR_VERSION=$( echo $MAJOR_VERSION | cut -d "-" -f2 )
fi
export RELEASE="${{ inputs.release }}"
export ARCH="${{ inputs.arch }}"
Expand All @@ -82,18 +92,19 @@ runs:
export APACHE_GROUP="www-data"
fi
MAJOR_LEFT=$( echo $MAJOR_VERSION | cut -d "." -f1 )
MAJOR_RIGHT=$( echo $MAJOR_VERSION | cut -d "-" -f1 | cut -d "." -f2 )
BUMP_MAJOR_RIGHT=$(( MAJOR_RIGHT_PART + 1 ))
if [ "$MAJOR_RIGHT" = "04" ]; then
BUMP_MAJOR_LEFT="$MAJOR_LEFT"
BUMP_MAJOR_RIGHT="10"
else
BUMP_MAJOR_LEFT=$(( $MAJOR_LEFT + 1 ))
BUMP_MAJOR_RIGHT="04"
if [[ "$MAJOR_VERSION" != "" ]]; then
MAJOR_LEFT=$( echo $MAJOR_VERSION | cut -d "." -f1 )
MAJOR_RIGHT=$( echo $MAJOR_VERSION | cut -d "-" -f1 | cut -d "." -f2 )
if [ "$MAJOR_RIGHT" = "04" ]; then
BUMP_MAJOR_LEFT="$MAJOR_LEFT"
BUMP_MAJOR_RIGHT="10"
else
BUMP_MAJOR_LEFT=$(( $MAJOR_LEFT + 1 ))
BUMP_MAJOR_RIGHT="04"
fi
export NEXT_MAJOR_VERSION="$BUMP_MAJOR_LEFT.$BUMP_MAJOR_RIGHT"
fi
export NEXT_MAJOR_VERSION="$BUMP_MAJOR_LEFT.$BUMP_MAJOR_RIGHT"
export RPM_SIGNING_KEY_FILE="$(pwd)/key.gpg"
export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID"
Expand Down
93 changes: 0 additions & 93 deletions .github/actions/package/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/connector-vmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Package
uses: ./.github/actions/package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "connectors/vmware/packaging/centreon-plugin-virtualization-vmware-daemon.yaml"
distrib: ${{ matrix.distrib }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nrpe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
shell: bash

- name: Package
uses: ./.github/actions/package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "nrpe/packaging/*.yaml"
distrib: ${{ matrix.distrib }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perl-crypt-argon2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-crypt-argon2-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-crypt-argon2-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perl-json-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: all
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perl-libssh-session.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perl-net-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-net-curl-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-net-curl-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/perl-openwsman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand All @@ -166,7 +166,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand All @@ -180,7 +180,7 @@ jobs:
package_extension: ${{ matrix.package_extension }}
arch: ${{ matrix.arch }}
commit_hash: ${{ github.sha }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-perl-openwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-openwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perl-vmware-vsphere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
fail-on-cache-miss: true

- name: Package
uses: ./.github/actions/package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml"
distrib: ${{ matrix.distrib }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plugins-selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
shell: bash

- name: Package
uses: ./.github/actions/package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "selinux/packaging/centreon-plugins-selinux.yaml"
distrib: ${{ matrix.distrib }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
done
shell: bash
- uses: ./.github/actions/package
- uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: ".github/packaging/*.yaml"
distrib: ${{ matrix.distrib }}
Expand Down

0 comments on commit 8451fdc

Please sign in to comment.