Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
7d04c512
Commit
7d04c512
authored
Sep 20, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automate creation of releases notes on GitHub
Closes gh-12552
parent
63d276da
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
0 deletions
+72
-0
pipeline.yml
ci/pipeline.yml
+30
-0
publish-release-notes.sh
ci/scripts/publish-release-notes.sh
+27
-0
stage.sh
ci/scripts/stage.sh
+1
-0
publish-release-notes.yml
ci/tasks/publish-release-notes.yml
+13
-0
stage.yml
ci/tasks/stage.yml
+1
-0
No files found.
ci/pipeline.yml
View file @
7d04c512
...
@@ -27,6 +27,11 @@ resources:
...
@@ -27,6 +27,11 @@ resources:
password
:
((github-password))
password
:
((github-password))
branch
:
((branch))
branch
:
((branch))
ignore_paths
:
[
"
ci/images/*"
]
ignore_paths
:
[
"
ci/images/*"
]
-
name
:
release-notes-repo
type
:
git
source
:
uri
:
https://github.com/mbhave/release-notes-generator
branch
:
master
-
name
:
git-pull-request
-
name
:
git-pull-request
type
:
pull-request
type
:
pull-request
source
:
source
:
...
@@ -307,6 +312,7 @@ jobs:
...
@@ -307,6 +312,7 @@ jobs:
-
get
:
spring-boot-ci-image
-
get
:
spring-boot-ci-image
-
get
:
git-repo
-
get
:
git-repo
trigger
:
false
trigger
:
false
-
get
:
release-notes-repo
-
task
:
stage
-
task
:
stage
image
:
spring-boot-ci-image
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/stage.yml
file
:
git-repo/ci/tasks/stage.yml
...
@@ -319,6 +325,14 @@ jobs:
...
@@ -319,6 +325,14 @@ jobs:
-
put
:
git-repo
-
put
:
git-repo
params
:
params
:
repository
:
stage-git-repo
repository
:
stage-git-repo
-
task
:
publish-release-notes
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/publish-release-notes.yml
params
:
GITHUB_ORGANIZATION
:
spring-projects
GITHUB_REPO
:
spring-boot
GITHUB_USERNAME
:
((github-username))
GITHUB_PASSWORD
:
((github-release-notes-access-token))
-
name
:
stage-rc
-
name
:
stage-rc
serial
:
true
serial
:
true
plan
:
plan
:
...
@@ -337,6 +351,14 @@ jobs:
...
@@ -337,6 +351,14 @@ jobs:
-
put
:
git-repo
-
put
:
git-repo
params
:
params
:
repository
:
stage-git-repo
repository
:
stage-git-repo
-
task
:
publish-release-notes
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/publish-release-notes.yml
params
:
GITHUB_ORGANIZATION
:
spring-projects
GITHUB_REPO
:
spring-boot
GITHUB_USERNAME
:
((github-username))
GITHUB_PASSWORD
:
((github-release-notes-access-token))
-
name
:
stage-release
-
name
:
stage-release
serial
:
true
serial
:
true
plan
:
plan
:
...
@@ -355,6 +377,14 @@ jobs:
...
@@ -355,6 +377,14 @@ jobs:
-
put
:
git-repo
-
put
:
git-repo
params
:
params
:
repository
:
stage-git-repo
repository
:
stage-git-repo
-
task
:
publish-release-notes
image
:
spring-boot-ci-image
file
:
git-repo/ci/tasks/publish-release-notes.yml
params
:
GITHUB_ORGANIZATION
:
spring-projects
GITHUB_REPO
:
spring-boot
GITHUB_USERNAME
:
((github-username))
GITHUB_PASSWORD
:
((github-release-notes-access-token))
-
name
:
promote-milestone
-
name
:
promote-milestone
serial
:
true
serial
:
true
plan
:
plan
:
...
...
ci/scripts/publish-release-notes.sh
0 → 100644
View file @
7d04c512
#!/bin/bash
set
-e
source
$(
dirname
$0
)
/common.sh
latest
=
$(
curl
-s
"https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/releases/latest"
-u
${
GITHUB_USERNAME
}
:
${
GITHUB_PASSWORD
}
)
id
=
$(
echo
$latest
| jq
-r
'.id'
)
milestone
=
$(
cat
version/stageVersion
)
milestone_number
=
$(
curl
-s
"https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/milestones"
-u
${
GITHUB_USERNAME
}
:
${
GITHUB_PASSWORD
}
| jq
-r
--arg
MILESTONE
"
${
milestone
}
"
'.[] | select(.title == $MILESTONE) | .number'
)
pushd
release-notes-repo
>
/dev/null
run_maven clean
install
java
-jar
-Dreleasenotes
.github.organization
=
${
GITHUB_ORGANIZATION
}
-Dreleasenotes
.github.name
=
${
GITHUB_REPO
}
target/github-release-notes-generator-0.0.1-SNAPSHOT.jar
"
${
milestone_number
}
"
release-notes.md
popd
>
/dev/null
body
=
$(
sed
-E
':a;N;$!ba;s/\r{0,1}\n/\\n/g'
release-notes-repo/release-notes.md
)
curl
\
-s
\
-u
${
GITHUB_USERNAME
}
:
${
GITHUB_PASSWORD
}
\
-H
"Content-type:application/json"
\
-d
"{
\"
body
\"
:
\"
${
body
}
\"
}"
\
-f
\
-X
\
PATCH
"https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/releases/
${
id
}
"
>
/dev/null
||
{
echo
"Failed to publish"
>
&2
;
exit
1
;
}
ci/scripts/stage.sh
View file @
7d04c512
...
@@ -51,3 +51,4 @@ fi;
...
@@ -51,3 +51,4 @@ fi;
echo
"DONE"
echo
"DONE"
popd
>
/dev/null
popd
>
/dev/null
echo
$stageVersion
>
version/stageVersion
ci/tasks/publish-release-notes.yml
0 → 100755
View file @
7d04c512
---
platform
:
linux
inputs
:
-
name
:
git-repo
-
name
:
release-notes-repo
-
name
:
version
params
:
GITHUB_ORGANIZATION
:
GITHUB_REPO
:
GITHUB_USERNAME
:
GITHUB_PASSWORD
:
run
:
path
:
git-repo/ci/scripts/publish-release-notes.sh
ci/tasks/stage.yml
View file @
7d04c512
...
@@ -5,6 +5,7 @@ inputs:
...
@@ -5,6 +5,7 @@ inputs:
outputs
:
outputs
:
-
name
:
stage-git-repo
-
name
:
stage-git-repo
-
name
:
distribution-repository
-
name
:
distribution-repository
-
name
:
version
params
:
params
:
RELEASE_TYPE
:
RELEASE_TYPE
:
caches
:
caches
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment