15
15
# jobs can work on it.
16
16
staging :
17
17
runs-on : ubuntu-latest
18
+ outputs :
19
+ project-version : ${{ steps.output.outputs.project-version }}
18
20
steps :
19
21
- uses : actions/checkout@v2
20
22
- uses : actions/setup-java@v1
57
59
tag-release-branch : ${{ env.PROJECT_VERSION }}
58
60
tag-release-tag : ${{ env.PROJECT_VERSION }}
59
61
tag-release-tag-prefix : v
62
+ - name : Output
63
+ id : output
64
+ env :
65
+ PROJECT_VERSION : ${{ env.PROJECT_VERSION }}
66
+ run : |
67
+ echo "::set-output name=project-version::$PROJECT_VERSION"
60
68
61
69
# wait manual approval.
62
70
# promote build from staging to releases
82
90
--server-id-deploy=repo.spring.io \
83
91
--repo-resolve=libs-release \
84
92
--repo-deploy=libs-staging-local
85
- echo JFROG_CLI_BUILD_NAME=spring-statemachine-24x -release >> $GITHUB_ENV
93
+ echo JFROG_CLI_BUILD_NAME=spring-statemachine-22x -release >> $GITHUB_ENV
86
94
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
87
95
# promoting build from staging repo into release
88
96
- name : Promote Build
@@ -97,13 +105,63 @@ jobs:
97
105
commit-changes-branch : 2.4.x
98
106
commit-changes-message : Next development version
99
107
108
+ # gh release before central
109
+ ghrelease :
110
+ runs-on : ubuntu-latest
111
+ needs : [staging, promote]
112
+ steps :
113
+ - uses : actions/checkout@v2
114
+ - name : Install Tooling
115
+ run : |
116
+ 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
117
+ - name : GitHub Release
118
+ env :
119
+ PROJECT_VERSION : ${{needs.staging.outputs.project-version}}
120
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
121
+ RELEASE_NOTES_FILE : ${{runner.temp}}/release_notes.md5
122
+ RELEASE_NOTES_DATA : ${{runner.temp}}/release_notes_data.json
123
+ RELEASE_NOTES_HEADERS : ${{runner.temp}}/release_notes_headers.json
124
+ RELEASE_NOTES_FOOTERS : ${{runner.temp}}/release_notes_footers.json
125
+ RELEASE_NOTES_ISSUES : ${{runner.temp}}/release_notes_issues.json
126
+ run : |
127
+ gh issue list \
128
+ --repo spring-projects/spring-statemachine \
129
+ --milestone $PROJECT_VERSION \
130
+ --label automation/rlnotes-header \
131
+ --state all --json title,body \
132
+ --jq '{headers:map(.),headerslength:(length)}' \
133
+ > $RELEASE_NOTES_HEADERS
134
+ gh issue list \
135
+ --repo spring-projects/spring-statemachine \
136
+ --milestone $PROJECT_VERSION \
137
+ --label automation/rlnotes-footer \
138
+ --state all --json title,body \
139
+ --jq '{footers:map(.),footerslength:(length)}' \
140
+ > $RELEASE_NOTES_FOOTERS
141
+ gh issue list \
142
+ --repo spring-projects/spring-statemachine \
143
+ --milestone $PROJECT_VERSION \
144
+ --state all --json number,title,labels \
145
+ --jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))))}' \
146
+ > $RELEASE_NOTES_ISSUES
147
+ jq -s '{issues:(.[0].issues),headers:(.[1].headers),headerslength:(.[1].headerslength),footers:(.[2].footers), footerslength:(.[2].footerslength)}' \
148
+ $RELEASE_NOTES_ISSUES \
149
+ $RELEASE_NOTES_HEADERS \
150
+ $RELEASE_NOTES_FOOTERS \
151
+ > $RELEASE_NOTES_DATA
152
+ mustache $RELEASE_NOTES_DATA .github/rlnotes.mustache > $RELEASE_NOTES_FILE
153
+ gh release create v$PROJECT_VERSION \
154
+ --draft \
155
+ --title "$PROJECT_VERSION" \
156
+ --notes-file $RELEASE_NOTES_FILE
157
+
100
158
# wait manual approval.
101
159
# pull released artifacts from repo and do a dance with central sync where we
102
160
# create checksum and signature files, create staging repo and upload
103
161
# files into it, and then finally close and release that repo.
104
162
central :
105
163
runs-on : ubuntu-latest
106
- needs : promote
164
+ needs : ghrelease
107
165
environment : central
108
166
steps :
109
167
# need repo for spec file
0 commit comments