-
Notifications
You must be signed in to change notification settings - Fork 583
158 lines (153 loc) · 9.89 KB
/
github-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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Github Release
on:
workflow_dispatch:
inputs:
build-zoo-handler:
description: 'Build Zoo Handler Payload'
required: true
env:
BUILD_ZOO_HANDLER_spring_cloud_deployer_version=2.9.1
BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version=3.4.1
BUILD_ZOO_HANDLER_spring_cloud_dataflow_version=2.11.1
jobs:
ghrelease:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/'
# zoo extract and ensure
# - name: Extract Zoo Context Properties
# uses: jvalkeal/[email protected]
# with:
# dispatch-handler-extract-context-properties: true
# ensure-env: |
# BUILD_ZOO_HANDLER_spring_cloud_deployer_version
# BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version
# BUILD_ZOO_HANDLER_spring_cloud_dataflow_version
# tooling
- name: Install Tooling
run: |
curl -sSL https://github.com/cbroglie/mustache/releases/download/v1.2.2/mustache_1.2.2_linux_amd64.tar.gz | sudo tar -C /usr/local/bin/ --no-same-owner -xzv mustache
# release notes and gh release
- name: Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RELEASE_NOTES_FILE: ${{runner.temp}}/release_notes.md5
RELEASE_NOTES_DATA: ${{runner.temp}}/release_notes_data.json
RELEASE_NOTES_HEADERS1: ${{runner.temp}}/release_notes_headers1.json
RELEASE_NOTES_HEADERS2: ${{runner.temp}}/release_notes_headers2.json
RELEASE_NOTES_HEADERS3: ${{runner.temp}}/release_notes_headers3.json
RELEASE_NOTES_FOOTERS1: ${{runner.temp}}/release_notes_footers1.json
RELEASE_NOTES_FOOTERS2: ${{runner.temp}}/release_notes_footers2.json
RELEASE_NOTES_FOOTERS3: ${{runner.temp}}/release_notes_footers3.json
RELEASE_NOTES_ISSUES1: ${{runner.temp}}/release_notes_issues1.json
RELEASE_NOTES_ISSUES2: ${{runner.temp}}/release_notes_issues2.json
RELEASE_NOTES_ISSUES3: ${{runner.temp}}/release_notes_issues3.json
RELEASE_NOTES_PROJECT1: ${{runner.temp}}/release_notes_project1.json
RELEASE_NOTES_PROJECT2: ${{runner.temp}}/release_notes_project2.json
RELEASE_NOTES_PROJECT3: ${{runner.temp}}/release_notes_project3.json
run: |
gh issue list \
--repo spring-cloud/spring-cloud-deployer \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_deployer_version \
--label automation/rlnotes-header \
--state all --json title,body \
--jq '{headers:map(.),headerslength:(length)}' \
> $RELEASE_NOTES_HEADERS1
gh issue list \
--repo spring-cloud/spring-cloud-dataflow-ui \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version \
--label automation/rlnotes-header \
--state all --json title,body \
--jq '{headers:map(.),headerslength:(length)}' \
> $RELEASE_NOTES_HEADERS2
gh issue list \
--repo spring-cloud/spring-cloud-dataflow \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \
--label automation/rlnotes-header \
--state all --json title,body \
--jq '{headers:map(.),headerslength:(length)}' \
> $RELEASE_NOTES_HEADERS3
gh issue list \
--repo spring-cloud/spring-cloud-deployer \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_deployer_version \
--label automation/rlnotes-footer \
--state all --json title,body \
--jq '{footers:map(.),footerslength:(length)}' \
> $RELEASE_NOTES_FOOTERS1
gh issue list \
--repo spring-cloud/spring-cloud-dataflow-ui \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version \
--label automation/rlnotes-footer \
--state all --json title,body \
--jq '{footers:map(.),footerslength:(length)}' \
> $RELEASE_NOTES_FOOTERS2
gh issue list \
--repo spring-cloud/spring-cloud-dataflow \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \
--label automation/rlnotes-footer \
--state all --json title,body \
--jq '{footers:map(.),footerslength:(length)}' \
> $RELEASE_NOTES_FOOTERS3
echo "{\"name\":\"Spring Cloud Dataflow Deployer\",\"version\":\"$BUILD_ZOO_HANDLER_spring_cloud_deployer_version\"}" > $RELEASE_NOTES_PROJECT1
echo "{\"name\":\"Spring Cloud Dataflow UI\",\"version\":\"$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version\"}" > $RELEASE_NOTES_PROJECT2
echo "{\"name\":\"Spring Cloud Dataflow\",\"version\":\"$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version\"}" > $RELEASE_NOTES_PROJECT3
gh issue list \
--repo spring-cloud/spring-cloud-deployer \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_deployer_version \
--state all --json number,title,labels \
--jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))) + {repo:"spring-cloud/spring-cloud-deployer"})}' \
> $RELEASE_NOTES_ISSUES1
gh issue list \
--repo spring-cloud/spring-cloud-dataflow-ui \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_ui_version \
--state all --json number,title,labels \
--jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))) + {repo:"spring-cloud/spring-cloud-dataflow-ui"})}' \
> $RELEASE_NOTES_ISSUES2
gh issue list \
--repo spring-cloud/spring-cloud-dataflow \
--search milestone:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \
--state all --limit 100 --json number,title,labels \
--jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))) + {repo:"spring-cloud/spring-cloud-dataflow"})}' \
> $RELEASE_NOTES_ISSUES3
jq -s '{issues:(.[0].issues + .[1].issues + .[2].issues + .[3].issues + .[4].issues + .[5].issues + .[6].issues + .[7].issues + .[8].issues + .[9].issues),headers:(.[10].headers + .[11].headers + .[12].headers + .[13].headers + .[14].headers + .[15].headers + .[16].headers + .[17].headers + .[18].headers + .[19].headers),headerslength:(.[10].headerslength + .[11].headerslength + .[12].headerslength + .[13].headerslength + .[14].headerslength + .[15].headerslength + .[16].headerslength + .[17].headerslength + .[18].headerslength + .[19].headerslength),footers:(.[20].footers + .[21].footers + .[22].footers + .[23].footers + .[24].footers + .[25].footers + .[26].footers + .[27].footers + .[28].footers + .[29].footers), footerslength:(.[20].footerslength + .[21].footerslength + .[22].footerslength + .[23].footerslength + .[24].footerslength + .[25].footerslength + .[26].footerslength + .[27].footerslength + .[28].footerslength + .[29].footerslength),projects:{spring_cloud_dataflow_build:{name:"Spring Cloud Dataflow Build",version:(.[30].version)},spring_cloud_dataflow_common:{name:"Spring Cloud Dataflow Common",version:(.[31].version)},spring_cloud_deployer:{name:"Spring Cloud Deployer",version:(.[32].version)},spring_cloud_deployer_local:{name:"Spring Cloud Deployer Local",version:(.[33].version)},spring_cloud_deployer_cloudfoundry:{name:"Spring Cloud Deployer CF",version:(.[34].version)},spring_cloud_deployer_kubernetes:{name:"Spring Cloud Deployer K8S",version:(.[35].version)},spring_cloud_common_security_config:{name:"Spring Cloud Common Security Config",version:(.[36].version)},spring_cloud_skipper:{name:"Spring Cloud Skipper",version:(.[37].version)},spring_cloud_dataflow_ui:{name:"Spring Cloud Dataflow UI",version:(.[38].version)},spring_cloud_dataflow:{name:"Spring Cloud Dataflow",version:(.[39].version)}}}' \
$RELEASE_NOTES_ISSUES1 $RELEASE_NOTES_ISSUES2 $RELEASE_NOTES_ISSUES3 \
$RELEASE_NOTES_HEADERS1 $RELEASE_NOTES_HEADERS2 $RELEASE_NOTES_HEADERS3 \
$RELEASE_NOTES_FOOTERS1 $RELEASE_NOTES_FOOTERS2 $RELEASE_NOTES_FOOTERS3 \
$RELEASE_NOTES_PROJECT1 $RELEASE_NOTES_PROJECT2 $RELEASE_NOTES_PROJECT3 \
> $RELEASE_NOTES_DATA
mustache $RELEASE_NOTES_DATA .github/rlnotes.mustache > $RELEASE_NOTES_FILE
gh release create v$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \
--draft \
--title "Spring Cloud Data Flow $BUILD_ZOO_HANDLER_spring_cloud_dataflow_version" \
--notes-file $RELEASE_NOTES_FILE
# retrieve spring-cloud-dataflow-package and upload to github release
mvn -gs .github/settings.xml \
dependency:copy \
-Dartifact=org.springframework.cloud:spring-cloud-dataflow-package:$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version:zip \
-DoutputDirectory=.
gh release upload v$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version \
spring-cloud-dataflow-package-$BUILD_ZOO_HANDLER_spring_cloud_dataflow_version.zip \
--clobber
# zoo success
- name: Notify Build Success Zoo Handler Controller
uses: jvalkeal/[email protected]
with:
dispatch-handler-token: ${{ secrets.SCDF_ACCESS_TOKEN }}
dispatch-handler-client-payload-data: >
{
"event": "ghrelease-succeed"
}
# zoo failure
- name: Notify Build Failure Zoo Handler Controller
if: ${{ failure() }}
uses: jvalkeal/[email protected]
with:
dispatch-handler-token: ${{ secrets.REPO_ACCESS_TOKEN }}
dispatch-handler-client-payload-data: >
{
"event": "ghrelease-failed"
}