Debian Codegraph @

ansible_collections/community/vmware/tools/prepare_release.yml

raw
1 - name: Prepare release
2 hosts: localhost
3 gather_facts: false
4 tasks:
5 - name: Generate version
6 when: version is not defined
7 block:
8 - name: Get the next release version
9 ansible.builtin.shell: git tag --sort=-creatordate --merged|head -n1|perl -pe 's/(\d+\.)(\d+)\.\d+/"$1" . ($2+1) . ".0"/e'
10 register: result
11
12 - name: Set the release version
13 ansible.builtin.set_fact:
14 version: "{{ result.stdout }}"
15
16 - name: Create release branch
17 ansible.builtin.shell: git checkout -b "prepare_{{ version }}_release"
18
19 - name: Update galaxy.yml
20 ansible.builtin.lineinfile:
21 path: "{{ playbook_dir }}/../galaxy.yml"
22 regexp: "^version: "
23 line: "version: {{ version }}"
24
25 - name: Update changelog
26 block:
27 - name: Install tox
28 ansible.builtin.pip:
29 name: tox
30
31 - name: Refresh the changelog
32 ansible.builtin.shell: 'tox -e antsibull-changelog -- release --verbose --version {{ version }}'
33
34 - name: Add everything
35 ansible.builtin.shell: git add --all
36
37 # git diff-index --quiet HEAD
38 # 0 -> repository is clean, nothing to commit
39 # 1 -> the opposite
40 - name: Commit everything
41 ansible.builtin.shell: 'git diff-index --quiet HEAD || git commit -m "prepare {{ version }} release"'