-
Notifications
You must be signed in to change notification settings - Fork 30
121 lines (99 loc) · 3.5 KB
/
release.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
---
name: New release
on:
workflow_dispatch:
push:
branches:
- master
env:
NAMESPACE: telekom_mms
COLLECTION_NAME: icinga_director
ANSIBLE_COLLECTIONS_PATHS: ./
jobs:
update_docs:
runs-on: ubuntu-latest
name: create documentation inside docs-folder
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
# ansible-doc-extractor requires the collection to be in a directory in
# the form ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/
- name: Check out code to ansible collection location
uses: actions/[email protected]
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install ansible-doc-extractor
run: python -m pip install ansible-doc-extractor[ansible]
- name: create documentation
run: ansible-doc-extractor docs/ plugins/inventory/* plugins/modules/*
- name: commit documentation
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'update documentation'
force-add: 'true'
files: docs/
name: Telekom MMS GmbH
email: [email protected]
generate_changelog:
runs-on: ubuntu-latest
name: create release draft
needs: update_docs # the documentation should be updated before creating a new release
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install antsibull-changelog, antsichaut
run: python -m pip install antsibull-changelog antsichaut --disable-pip-version-check
- name: Install pandoc
run: sudo apt-get install pandoc
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: calculate next version
id: version
uses: patrickjahns/version-drafter-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate new version in changelog.yaml
run: antsibull-changelog release -v --version "${{ steps.version.outputs.next-version }}"
- name: Generate changelog.yaml
run: antsichaut
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SINCE_VERSION: "${{ steps.previoustag.outputs.tag }}"
- name: Update Changelog.rst
run: antsibull-changelog generate -v
- name: push changelog
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'update changelog'
force-add: 'true'
files: CHANGELOG.rst changelogs/
name: Telekom MMS GmbH
email: [email protected]
rebase: true
# do a second checkout to prevent race situation
# changelog gets updated but action works on old commit id
- uses: actions/[email protected]
with:
ref: master
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}