-
Notifications
You must be signed in to change notification settings - Fork 5
202 lines (199 loc) · 6.89 KB
/
release_pipeline_dual.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
# This workflow action will run pre-commit, which will execute ansible and yaml linting
# See .pre-commit-config.yaml for what hooks are executed
name: Release
on:
workflow_call:
inputs:
collection_namespace_1:
description: First namespace to push to as in 'infra'
required: true
type: string
collection_namespace_2:
description: Second namespace like redhat_cop
required: true
type: string
collection_name_1:
description: "Path to the collection source"
required: true
type: string
collection_name_2:
description: "Path to the collection source"
required: true
type: string
collection_version:
description: The final collection path
required: false
type: string
collection_repo:
description: The collection url
required: false
type: string
quay_username:
description: "username/namespace to upload the EE to"
required: true
type: string
collection_dependencies:
description: The collection dependencies (as a space separated list)
required: false
type: string
publish_url_collection_1:
description: The url to publish to
default: 'https://galaxy.ansible.com'
required: false
type: string
publish_url_collection_2:
description: The url to publish to
default: 'https://galaxy.ansible.com'
required: false
type: string
ah_publish_1:
description: Publish the collection on automation hub
default: false
type: boolean
ah_publish_2:
description: Publish the collection on automation hub
default: false
type: boolean
galaxy_publish_1:
default: true
description: Publish the collection on galaxy
type: boolean
galaxy_publish_2:
default: true
description: Publish the collection on galaxy
type: boolean
matrix_message:
description: The additional message to send about the release.
default: ''
required: false
type: string
secrets:
collection_api_key_1:
description: API key for galaxy
required: true
collection_api_key_2:
description: API key for galaxy
required: true
git_token:
description: token for uploading tarballs to a release
required: true
quay_token:
description: token for quay
required: true
matrix_token:
description: token for quay
required: true
jobs:
pre-commit:
uses: redhat-cop/ansible_collections_tooling/.github/workflows/pre-commit.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace_1 }}
collection_name: ${{ inputs.collection_name_1 }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
collection_dependencies: ${{ inputs.collection_dependencies }}
sanity:
uses: redhat-cop/ansible_collections_tooling/.github/workflows/sanity.yml@main
with:
collection_dependencies: ${{ inputs.collection_dependencies }}
prechecks:
needs:
- pre-commit
- sanity
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.pre-commit.result }}',
'${{ needs.sanity.result }}',
]) == {'success'}"
release_collection_1:
needs:
- prechecks
uses: redhat-cop/ansible_collections_tooling/.github/workflows/release.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace_1 }}
collection_name: ${{ inputs.collection_name_1 }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
publish_url: ${{ inputs.publish_url_collection_1 }}
ah_publish: ${{ inputs.ah_publish_1 }}
galaxy_publish: ${{ inputs.galaxy_publish_1 }}
secrets:
api_key: ${{ secrets.collection_api_key_1 }}
token: ${{ secrets.git_token }}
release_collection_2:
needs:
- release_collection_1
uses: redhat-cop/ansible_collections_tooling/.github/workflows/release.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace_2 }}
collection_name: ${{ inputs.collection_name_2 }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
publish_url: ${{ inputs.publish_url_collection_2 }}
ah_publish: ${{ inputs.ah_publish_2 }}
galaxy_publish: ${{ inputs.galaxy_publish_2 }}
secrets:
api_key: ${{ secrets.collection_api_key_2 }}
token: ${{ secrets.git_token }}
release_check:
needs:
- release_collection_1
- release_collection_2
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.release_collection_1.result }}',
'${{ needs.release_collection_2.result }}',
]) == {'success'}"
deployEE:
needs:
- release_check
uses: redhat-cop/ansible_collections_tooling/.github/workflows/build_ee.yml@main
with:
quay_username: ${{ inputs.quay_username }}
secrets:
quay_token: ${{ secrets.quay_token }}
changelog:
needs:
- release_check
uses: redhat-cop/ansible_collections_tooling/.github/workflows/create_changelog.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace_1 }}
collection_name: ${{ inputs.collection_name_1 }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
secrets:
token: ${{ secrets.git_token }}
send-message:
needs:
- release_check
runs-on: ubuntu-latest
name: Send message via Matrix
steps:
- name: Send message to newsbot channel
uses: fadenb/[email protected]
with:
homeserver: 'matrix.org'
token: ${{ secrets.matrix_token }}
channel: '!pMZboYFCScZJfXmOtH:ansible.im' # This is Ansible Social
messagetype: 'm.text'
message: |
@newsbot ${{ inputs.collection_namespace_1 }}.${{ inputs.collection_name_1 }} ${{ inputs.collection_version }} has been released.\
${{ inputs.matrix_message }}\
Visit ${{ inputs.collection_repo }} For more information and updates.
- name: Send message to our channel
uses: fadenb/[email protected]
with:
homeserver: 'matrix.org'
token: ${{ secrets.matrix_token }}
channel: '!ccrdinGkMeyakqWzIM:matrix.org' # This is our room
messagetype: 'm.text'
message: |
${{ inputs.collection_namespace_1 }}.${{ inputs.collection_name_1 }} ${{ inputs.collection_version }} has been released.\
${{ inputs.matrix_message }}\
Visit ${{ inputs.collection_repo }} For more information and updates.
...