summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-19 22:53:20 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-20 09:30:20 -0800
commit5be81e76ea1a329e713cf809aa02157cbef09ea1 (patch)
treeedd6738013c46b6ab5bb86b15ec196365188a675
parent603626b3ce2b38035237017445c663ed3200f00e (diff)
downloadchef-better_pipelines.tar.gz
Add a simple Expeditor script to tag github releasesbetter_pipelines
Extract the current release release's notes and create a release with those Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.expeditor/config.yml4
-rw-r--r--.expeditor/scripts/create_github_release.sh28
2 files changed, 31 insertions, 1 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index fd8ed4a311..d501cf24d9 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -75,7 +75,7 @@ merge_actions:
ignore_labels:
- "Expeditor: Skip Version Bump"
- "Expeditor: Skip All"
- - bash:.expeditor/scripts/scripts/update_version.sh:
+ - bash:.expeditor/scripts/update_version.sh:
only_if: built_in:bump_version
- built_in:update_changelog:
ignore_labels:
@@ -107,6 +107,8 @@ subscriptions:
- built_in:tag_docker_image
- built_in:publish_rubygems
- built_in:notify_chefio_slack_channels
+ - bash:.expeditor/scripts/create_github_release.sh:
+ post_commit: true
# the habitat chain
- workload: buildkite_hab_build_group_published:{{agent_id}}:*
diff --git a/.expeditor/scripts/create_github_release.sh b/.expeditor/scripts/create_github_release.sh
new file mode 100644
index 0000000000..dc637b6be0
--- /dev/null
+++ b/.expeditor/scripts/create_github_release.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+############################################################################
+# What is this script?
+#
+# Chef uses a workflow tool called Expeditor to manage version bumps, changelogs
+# and releases. After a release is promoted this script runs to extract the
+# latest release information from the release notes and post that to Github
+# as a release.
+############################################################################
+
+set -evx
+
+snap install --classic hub
+
+RELEASE_TITLE=`grep -Pom1 '(?<=# )Chef Infra Client .*' RELEASE_NOTES.md`
+
+wget https://github.com/dahlia/submark/releases/download/0.2.0/submark-linux-x86_64 -O submark
+
+chmod 755 submark
+
+echo -e "Chef Infra Client ${EXPEDITOR_VERSION}\n" > release_description.md
+
+./submark --h1 "${RELEASE_TITLE}" --omit-heading RELEASE_NOTES.md >> release_description.md
+
+hub release create --file release_description.md "v${EXPEDITOR_VERSION}"
+
+rm release_description.md \ No newline at end of file