Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit eef5b65

Browse files
automate release (#258)
1 parent c27a763 commit eef5b65

10 files changed

+127
-9
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# https://github.com/marketplace/actions/release-drafter
2+
# As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready
3+
4+
template: |
5+
Compatible with Elasticsearch (**set version here**).
6+
$CHANGES
7+
8+
# Setting the formatting and sorting for the release notes body
9+
name-template: Version (set version here)
10+
change-template: '* $TITLE (#$NUMBER)'
11+
sort-by: merged_at
12+
sort-direction: ascending
13+
replacers:
14+
- search: '##'
15+
replace: '###'
16+
17+
# Organizing the tagged PRs into unified ODFE categories
18+
categories:
19+
- title: 'Breaking changes'
20+
labels:
21+
- 'breaking change'
22+
- title: 'Features'
23+
labels:
24+
- 'feature'
25+
- title: 'Enhancements'
26+
labels:
27+
- 'enhancement'
28+
- 'action'
29+
- 'API'
30+
- title: 'Bug Fixes'
31+
labels:
32+
- 'bug'
33+
- title: 'Infrastructure'
34+
labels:
35+
- 'infra'
36+
- 'testing'
37+
- 'CI/CD'
38+
- 'dependencies'
39+
- title: 'Documentation'
40+
labels:
41+
- 'documentation'
42+
- title: 'Maintenance'
43+
labels:
44+
- 'version support'
45+
- title: 'Refactoring'
46+
labels:
47+
- 'Refactor'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
update_release_draft:
10+
name: Update draft release notes
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Update draft release notes
14+
uses: release-drafter/release-drafter@v5
15+
with:
16+
config-name: draft-release-notes-config.yml
17+
name: Version (set here)
18+
tag: (None)
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-notes/create_release_notes.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# raw note means the draft release content copied down which is generated by Github workflow
2+
# this script helps add the URLs to all PR and have the right release note filename
3+
4+
import os
5+
import sys
6+
import fileinput
7+
import re
8+
9+
link_prefix = "https://github.com/opendistro-for-elasticsearch/index-management/pull/"
10+
searchExp = re.compile("([\(\[]).*?([\)\]])")
11+
12+
current_date = raw_input("what day is today (e.g. 2020-06-29): ")
13+
file_path = raw_input("Path to raw note file (e.g., note.md): ")
14+
plugin_name = "index-management"
15+
plugin_version = raw_input('Plugin version (x.x.x.x): ')
16+
17+
app_num = int(
18+
raw_input('Elasticsearch plugin (enter 1) or Kibana plugin (enter 2)? '))
19+
app = 'Elasticsearch'
20+
if app_num is 2:
21+
app = 'Kibana'
22+
23+
app_version = raw_input(app + ' compatibility version (x.x.x): ')
24+
25+
for line in fileinput.input(file_path, inplace=True):
26+
# Add title and ES/Kibana compatibility
27+
if fileinput.isfirstline():
28+
line = "## Version " + plugin_version + " " + current_date + "\n\n" \
29+
"Compatible with " + app + " " + app_version + "\n"
30+
31+
# Add link to PRs
32+
if '*' in line:
33+
start = line.find('#') + 1
34+
end = line.find(')', start)
35+
pr_num = line[start:end]
36+
line = re.sub(searchExp, "([#" + pr_num +
37+
"](" + link_prefix + pr_num + "))", line)
38+
sys.stdout.write(line)
39+
40+
# Rename file to be consistent with ODFE standards
41+
new_file_path = "opendistro-for-elasticsearch-" + plugin_name + ".release-notes-" + \
42+
plugin_version + ".md"
43+
os.rename(file_path, new_file_path)
44+
45+
print('\n\nDone!\n')

release-notes/opendistro-elasticsearch-index-management-1.3.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.3.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
## Version 1.3.0.0 (2019-12-17)
33

4-
### New Features
4+
### Features
55

66
This is the first official release of Open Distro Index Management plugin.
77

release-notes/opendistro-elasticsearch-index-management-1.4.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.4.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
## Version 1.4.0.0
33

4-
### New Features
4+
### Features
55
* Adds support for Elasticsearch 7.4.2 [PR #132](https://github.com/opendistro-for-elasticsearch/index-management/pull/132)
66

77
### Bug Fixes

release-notes/opendistro-elasticsearch-index-management-1.6.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.6.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
## Version 1.6.0.0 (2020-3-26)
33

4-
### New Features
4+
### Features
55
* Adds support for Elasticsearch 7.6.1 [PR #164](https://github.com/opendistro-for-elasticsearch/index-management/pull/164)
66
* Due to Changes in ES test framework since 7.5
77
* Update Jacoco (code coverage)

release-notes/opendistro-elasticsearch-index-management-1.7.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.7.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Compatible with Elasticsearch 7.6.1, Adds support for ODFE 1.7.0
55

6-
### New Features
6+
### Features
77
* Adds rollover conditions into info object [PR #208](https://github.com/opendistro-for-elasticsearch/index-management/pull/208)
88

99
### Enhancements

release-notes/opendistro-elasticsearch-index-management-1.8.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.8.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
Compatible with Elasticsearch 7.7.0, Adds support for ODFE 1.8.0
55

6-
### New Features
6+
### Features
77
* Snapshot implementation [PR #135](https://github.com/opendistro-for-elasticsearch/index-management/pull/135)
88

release-notes/opendistro-elasticsearch-index-management-1.9.0.md renamed to release-notes/opendistro-elasticsearch-index-management-1.9.0.0.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
Compatible with Elasticsearch 7.8.0, Adds support for ODFE 1.9.0
55

6-
### New Features
6+
### Features
77
* Adds support for Elasticsearch 7.8.0 [PR #246](https://github.com/opendistro-for-elasticsearch/index-management/pull/246)
88

9-
### Enhancement
9+
### Enhancements
1010
* Implement set index priority action [PR #241](https://github.com/opendistro-for-elasticsearch/index-management/pull/241)
1111

12-
### Bug Fixes
13-
* Fixes snapshot bugs [PR #244](https://github.com/opendistro-for-elasticsearch/index-management/pull/244)
1412

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
## Version 1.9.0.1
3+
4+
Compatible with Elasticsearch 7.8.0, Adds support for ODFE 1.9.0
5+
6+
### Bug Fixes
7+
* Fixes snapshot bugs [PR #244](https://github.com/opendistro-for-elasticsearch/index-management/pull/244)
8+

0 commit comments

Comments
 (0)