Skip to content

Commit a5c6416

Browse files
authored
Add workflow and steps to validate for and publishing to Ansible Galaxy (#230)
Signed-off-by: Webster Mudge <[email protected]>
1 parent 0c6b85b commit a5c6416

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/publish_galaxy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
3+
# Copyright 2024 Cloudera, Inc. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
name: Publish to Ansible Galaxy
18+
19+
on:
20+
release:
21+
types: [published]
22+
23+
jobs:
24+
galaxy_release:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Publish collection to Ansible Galaxy
33+
uses: ansible/[email protected]
34+
with:
35+
api_key: "${{ secrets.GALAXY_API_KEY }}"

.github/workflows/validate_pr.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
# Copyright 2023 Cloudera, Inc. All Rights Reserved.
3+
# Copyright 2024 Cloudera, Inc. All Rights Reserved.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -81,3 +81,10 @@ jobs:
8181
with:
8282
name: pr_number
8383
path: pr/
84+
85+
import-galaxy:
86+
needs: validate
87+
permissions:
88+
contents: read
89+
name: Import collection with Galaxy importer
90+
uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main

0 commit comments

Comments
 (0)