forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider: update changelog via seperate script and update release scr…
…ipt to just push tag (hashicorp#28131) * provider: update changelog via tag workflow instead of release script * address pr comments and remove commit from changelog script * remove workflow for now * rename file
- Loading branch information
Showing
3 changed files
with
43 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
if [[ "$(uname)" == "Darwin" ]]; then | ||
echo "(Using BSD sed)" | ||
SED="sed -E" | ||
else | ||
echo "(Using GNU sed)" | ||
SED="sed -r" | ||
fi | ||
|
||
DATE="$(date '+%B %d, %Y')" | ||
PROVIDER_URL="https:\/\/github.com\/hashicorp\/terraform-provider-azurerm\/issues" | ||
|
||
echo "Preparing changelog for release..." | ||
|
||
if [[ ! -f CHANGELOG.md ]]; then | ||
echo "Error: CHANGELOG.md not found." | ||
exit 2 | ||
fi | ||
|
||
# Get the next release | ||
RELEASE="$($SED -n 's/^## v?([0-9.]+) \(Unreleased\)/\1/p' CHANGELOG.md)" | ||
if [[ "${RELEASE}" == "" ]]; then | ||
echo "Error: could not determine next release in CHANGELOG.md" >&2 | ||
exit 3 | ||
fi | ||
|
||
# Replace [GH-nnnn] references with issue links | ||
( set -x; ${debug}$SED -i.bak "s/\[GH-([0-9]+)\]/\(\[#\1\]\(${PROVIDER_URL}\/\1\)\)/g" CHANGELOG.md ) | ||
|
||
# Set the date for the latest release | ||
( set -x; ${debug}$SED -i.bak "s/^(## v?[0-9.]+) \(Unreleased\)/\1 (${DATE})/i" CHANGELOG.md ) | ||
|
||
${debug}rm CHANGELOG.md.bak | ||
|
||
echo "exporting Provider Schema JSON" | ||
( | ||
set -x | ||
${debug}go run internal/tools/schema-api/main.go -export .release/provider-schema.json | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters