From 5be81e76ea1a329e713cf809aa02157cbef09ea1 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 19 Feb 2020 22:53:20 -0800 Subject: Add a simple Expeditor script to tag github releases Extract the current release release's notes and create a release with those Signed-off-by: Tim Smith --- .expeditor/config.yml | 4 +++- .expeditor/scripts/create_github_release.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .expeditor/scripts/create_github_release.sh 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 -- cgit v1.2.1