forked from SQiShER/java-object-diff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.yml
107 lines (91 loc) · 3.31 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
---
#
# This playbook is only meant to be used by the project maintainer.
#
# Usage: ansible-playbook release.yml --ask-vault-pass
#
# Of course this script requires to be run on a machine with the GPG key installed
#
- hosts: localhost
connection: local
vars_files:
- release_vars.yml
vars_prompt:
- name: "release_version"
prompt: "Release version"
private: no
- name: "release_description"
prompt: "Description"
private: no
vars:
files_with_version_reference:
- "README.md"
- "docs/maven.md"
tasks:
# TODO The versions could be easily updated via Ansible; changelog warning may be removed
- pause:
prompt: Make sure the changelog is up-to-date (Press ENTER to continue)
- name: replace maven version in readme and docs
replace:
dest: "{{ item }}"
regexp: '<version>[0-9\.]+</version>'
replace: "<version>{{ release_version }}</version>"
with_items: files_with_version_reference
- name: replace gradle version in readme and docs
replace:
dest: "{{ item }}"
regexp: 'de.danielbechler:java-object-diff:[0-9\.]+'
replace: "de.danielbechler:java-object-diff:{{ release_version }}"
with_items: files_with_version_reference
# TODO: I'm not quite sure if the changes above need to be commited before performing a mvn release
# Guess I'll find out with the next release...
# TODO Automate via command or shell module
- pause:
prompt: Perform mvn release:prepare (Press ENTER to continue)
- name: create new version on bintray
uri:
url: "https://api.bintray.com/packages/sqisher/maven/java-object-diff/versions"
method: POST
user: "{{ bintray.user }}"
password: "{{ bintray.password }}"
force_basic_auth: yes
body:
name: "{{ release_version }}"
desc: "{{ release_description }}"
github_release_notes_file: "CHANGELOG.md"
github_use_tag_release_notes: True
vcs_tag: "java-object-diff-{{ release_version }}"
body_format: json
timeout: 120
status_code: 201
# TODO Automate via command or shell module
- pause:
prompt: Perform mvn release:perform (Press ENTER to continue)
- name: sign version artifacts
uri:
url: "https://api.bintray.com/gpg/sqisher/maven/java-object-diff/versions/{{ release_version }}"
method: POST
user: "{{ bintray.user }}"
password: "{{ bintray.password }}"
force_basic_auth: yes
"HEADER_X-GPG-PASSPHRASE": "{{ gpg.passphrase }}"
- name: publish artifacts
uri:
url: "https://api.bintray.com/content/sqisher/maven/java-object-diff/{{ release_version }}/publish"
method: POST
user: "{{ bintray.user }}"
password: "{{ bintray.password }}"
force_basic_auth: yes
- name: sync to maven central
uri:
url: "https://api.bintray.com/maven_central_sync/sqisher/maven/java-object-diff/versions/{{ release_version }}"
method: POST
user: "{{ bintray.user }}"
password: "{{ bintray.password }}"
force_basic_auth: yes
body_format: json
body:
username: "{{ sonatype.user }}"
password: "{{ sonatype.token }}"
close: "1"
timeout: 120