From 01b83842836d3728fdcb354db6f2ddf67ba09cb7 Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Tue, 5 Sep 2023 10:29:03 +0200 Subject: [PATCH] enh(release): push plugins release tag (#4623) Refs: MON-20486 --- .github/workflows/plugin-delivery.yml | 25 +++++++++++++++++++++++++ .github/workflows/plugins.yml | 2 -- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/plugin-delivery.yml b/.github/workflows/plugin-delivery.yml index 42a454899..33438c636 100644 --- a/.github/workflows/plugin-delivery.yml +++ b/.github/workflows/plugin-delivery.yml @@ -149,3 +149,28 @@ jobs: nexus_password: ${{ secrets.nexus_password }} cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} stability: ${{ inputs.stability }} + + release-tag: + if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }} + runs-on: ubuntu-22.04 + + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Push git release tag + run: | + RELEASE=plugins-$(date '+%Y%m%d') + + EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1) + + git config --global user.email "release@centreon.com" + git config --global user.name "Centreon" + + if [ -z "$EXISTING_TAG" ]; then + git tag -a "$RELEASE" -m "release $RELEASE" + git push --follow-tags + else + echo "::warning::Release tag $RELEASE already exists" + fi + shell: bash diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 6745b3758..64b5c0a32 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -19,8 +19,6 @@ on: - '.github/workflows/plugins.yml' - 'src/**' - 'packaging/**' - tags: - - centreon-plugins-* jobs: get-environment: