-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (68 loc) · 2.42 KB
/
ansible_collection_cd.yml
File metadata and controls
73 lines (68 loc) · 2.42 KB
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
# Ansible Module release workflow.
name: CD
# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
workflow_call:
# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
#permissions:
# contents: write
# Default values to simplify job configurations below.
env:
# Python language version to use This value should also be updated
# in the testing workflow if changed.
PYTHON_VERSION: '3.10'
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release_please.outputs.release_created }}
steps:
- name: DevOpsArrBOT token
id: DevOpsArrBOT
uses: getsentry/action-github-app-token@v3
with:
app_id: '305652'
private_key: ${{ secrets.DEVOPSARRBOT_PRIVATE_KEY }}
- name: set DevOpsArrBOT config
run: |
git config --global user.name "devopsarr[bot]"
git config --global user.email 127950054+devopsarr[bot]@users.noreply.github.com
- uses: actions/checkout@v5
with:
# Allow relase please to access older tag information.
fetch-depth: 0
token: ${{ steps.DevOpsArrBOT.outputs.token }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Release Please
id: release_please
uses: google-github-actions/release-please-action@v4
with:
release-type: python
token: ${{ steps.DevOpsArrBOT.outputs.token }}
extra-files: |
galaxy.yml
- name: Update changelog
if: ${{ !steps.release_please.outputs.release_created }}
run: |
pip install antsibull-changelog --disable-pip-version-check &&\
git fetch --all &&\
git checkout release-please--branches--main &&\
antsibull-changelog release --refresh &&\
git add . &&\
git commit --amend --no-edit &&\
git push -f
collection-release:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v5
- name: Upload collection to Ansible Galaxy
uses: ansible/ansible-publish-action@v1.0.0
with:
api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}