-
Notifications
You must be signed in to change notification settings - Fork 5
129 lines (127 loc) · 4.07 KB
/
release_pipeline.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
---
# 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:
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:
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
secrets:
galaxy_api_key:
description: API key for galaxy
required: true
infra_api_key:
description: API key for galaxy
required: true
token:
description: token for uploading tarballs to a release
required: true
quay_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 }}
collection_name: ${{ inputs.collection_name }}
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'}"
cop_release:
needs:
- prechecks
uses: redhat-cop/ansible_collections_tooling/.github/workflows/release.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace_2 }}
collection_name: ${{ inputs.collection_name }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
secrets:
api_key: ${{ secrets.galaxy_api_key }}
token: ${{ secrets.token }}
infra_release:
needs:
- cop_release
uses: redhat-cop/ansible_collections_tooling/.github/workflows/release.yml@main
with:
collection_namespace: ${{ inputs.collection_namespace }}
collection_name: ${{ inputs.collection_name }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
secrets:
api_key: ${{ secrets.infra_api_key }}
token: ${{ secrets.token }}
release_check:
needs:
- cop_release
- infra_release
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.infra_release.result }}',
'${{ needs.cop_release.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 }}
collection_name: ${{ inputs.collection_name }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
secrets:
token: ${{ secrets.token }}
...