forked from centreon/centreon-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (138 loc) · 5.09 KB
/
plugin-delivery.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
on:
workflow_call:
inputs:
version:
description: The package version
type: string
required: true
release:
description: The package release
type: string
required: true
stability:
description: The package stability (stable, testing, unstable)
type: string
required: true
secrets:
artifactory_token:
description: "The artifactory token"
required: true
token_download_centreon_com:
description: "The token to call download.centreon.com api"
required: true
jobs:
deliver-sources:
runs-on: [self-hosted, common]
if: ${{ contains(fromJson('["stable"]'), inputs.stability) && github.event_name != 'workflow_dispatch' }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ./build/
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Deliver sources
uses: ./.github/actions/release-sources
with:
bucket_directory: centreon-plugins
module_directory: build
module_name: centreon-plugins
version: ${{ inputs.version }}
release: ${{ inputs.release }}
token_download_centreon_com: ${{ secrets.token_download_centreon_com }}
deliver-rpm:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [el7, el8, el9]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-rpm-legacy:
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [el7, el8]
major_version: ["21.10", "22.04", "22.10"]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/rpm-delivery-legacy
with:
module_name: plugins
major_version: ${{ matrix.major_version }}
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-deb:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [bullseye, bookworm, jammy]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
deliver-deb-legacy:
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
fail-fast: false
matrix:
distrib: [bullseye]
major_version: ["22.04", "22.10"]
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Delivery
uses: ./.github/actions/deb-delivery-legacy
with:
module_name: plugins
distrib: ${{ matrix.distrib }}
major_version: ${{ matrix.major_version }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ inputs.stability }}
artifactory_token: ${{ secrets.artifactory_token }}
release-tag:
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- 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 "[email protected]"
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