Use github release resource for publishing release notes

This commit also marks a release as pre-release for milestones and RCs

Closes gh-14908
Closes gh-14875
pull/14914/head
Madhura Bhave 6 years ago
parent 2110215559
commit f145e81354

@ -39,6 +39,20 @@ resources:
repo: ((github-repo-name))
base: ((branch))
ignore_paths: ["ci/*"]
- name: github-pre-release
type: github-release
source:
owner: spring-projects
repository: spring-boot
access_token: ((github-release-notes-access-token))
pre_release: true
- name: github-release
type: github-release
source:
owner: spring-projects
repository: spring-boot
access_token: ((github-release-notes-access-token))
pre_release: false
- name: ci-images-git-repo
type: git
source:
@ -380,15 +394,20 @@ jobs:
ARTIFACTORY_SERVER: ((artifactory-server))
ARTIFACTORY_USERNAME: ((artifactory-username))
ARTIFACTORY_PASSWORD: ((artifactory-password))
- task: publish-release-notes
- task: generate-release-notes
image: spring-boot-ci-image
file: git-repo/ci/tasks/publish-release-notes.yml
file: git-repo/ci/tasks/generate-release-notes.yml
params:
RELEASE_TYPE: M
GITHUB_ORGANIZATION: spring-projects
GITHUB_REPO: spring-boot
GITHUB_USERNAME: ((github-username))
GITHUB_PASSWORD: ((github-release-notes-access-token))
- put: github-pre-release
params:
name: generated-release-notes/version
tag: generated-release-notes/version
body: generated-release-notes/body
- name: promote-rc
serial: true
plan:
@ -409,15 +428,20 @@ jobs:
ARTIFACTORY_SERVER: ((artifactory-server))
ARTIFACTORY_USERNAME: ((artifactory-username))
ARTIFACTORY_PASSWORD: ((artifactory-password))
- task: publish-release-notes
- task: generate-release-notes
image: spring-boot-ci-image
file: git-repo/ci/tasks/publish-release-notes.yml
file: git-repo/ci/tasks/generate-release-notes.yml
params:
RELEASE_TYPE: RC
GITHUB_ORGANIZATION: spring-projects
GITHUB_REPO: spring-boot
GITHUB_USERNAME: ((github-username))
GITHUB_PASSWORD: ((github-release-notes-access-token))
- put: github-pre-release
params:
name: generated-release-notes/version
tag: generated-release-notes/version
body: generated-release-notes/body
- name: promote-release
serial: true
plan:
@ -440,15 +464,20 @@ jobs:
ARTIFACTORY_PASSWORD: ((artifactory-password))
BINTRAY_SUBJECT: ((bintray-subject))
BINTRAY_REPO: ((bintray-repo))
- task: publish-release-notes
- task: generate-release-notes
image: spring-boot-ci-image
file: git-repo/ci/tasks/publish-release-notes.yml
file: git-repo/ci/tasks/generate-release-notes.yml
params:
RELEASE_TYPE: RELEASE
GITHUB_ORGANIZATION: spring-projects
GITHUB_REPO: spring-boot
GITHUB_USERNAME: ((github-username))
GITHUB_PASSWORD: ((github-release-notes-access-token))
- put: github-release
params:
name: generated-release-notes/version
tag: generated-release-notes/version
body: generated-release-notes/body
- name: sync-to-maven-central
serial: true
plan:

@ -15,14 +15,5 @@ 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 "{\"tag_name\":\"v${version}\",\"name\":\"v${version}\",\"body\": \"${body}\"}" \
-f \
-X \
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/releases" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
cat release-notes-repo/release-notes.md > generated-release-notes/body
echo v${version} > generated-release-notes/version

@ -4,6 +4,8 @@ inputs:
- name: git-repo
- name: release-notes-repo
- name: version
outputs:
- name: generated-release-notes
params:
GITHUB_ORGANIZATION:
GITHUB_REPO:
@ -11,4 +13,4 @@ params:
GITHUB_PASSWORD:
RELEASE_TYPE:
run:
path: git-repo/ci/scripts/publish-release-notes.sh
path: git-repo/ci/scripts/generate-release-notes.sh
Loading…
Cancel
Save