forked from bufbuild/buf
-
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.
* second script * second * Update version to 3.70.1
- Loading branch information
1 parent
7e95e1e
commit cedba97
Showing
4 changed files
with
59 additions
and
6 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,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
DIR="$(CDPATH= cd "$(dirname "${0}")/../../.." && pwd)" | ||
cd "${DIR}" | ||
|
||
# We already have set -u, but want to fail early if a required variable is not set. | ||
# : ${GH_TOKEN} | ||
# : ${WEBHOOK_URL} | ||
|
||
RELEASED_VERSION_LINE=$(grep -oE 'Version.*=.*\"[0-9]\.[0-9]+\.[0-9]+[^\"]*' private/buf/bufcli/bufcli.go) | ||
RELEASED_VERSION=${RELEASED_VERSION_LINE##Version*=*\"} | ||
# echo "released version is ${RELEASED_VERSION}" | ||
NEXT_VERSION=$(awk -F. -v OFS=. '{$NF += 1 ; print}' <<< ${RELEASED_VERSION}) | ||
NEXT_VERSION="${NEXT_VERSION}-dev" | ||
|
||
make updateversion VERSION=${NEXT_VERSION} | ||
|
||
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then | ||
SED_BIN=sed | ||
elif [[ "${OSTYPE}" == "darwin"* ]]; then | ||
SED_BIN=gsed | ||
else | ||
echo "unsupported OSTYPE: ${OSTYPE}" | ||
exit 1 | ||
fi | ||
|
||
${SED_BIN} -i "/^# Changelog/ { | ||
N; | ||
a\ | ||
## [Unreleased]\\ | ||
\\ | ||
- No changes yet.\\ | ||
}" CHANGELOG.md | ||
|
||
${SED_BIN} -i "/^Initial beta release.$/ { | ||
N; | ||
a\ | ||
[Unreleased]: https://github.com/bufbuild/buf/compare/v${RELEASED_VERSION}...HEAD | ||
}" CHANGELOG.md | ||
|
||
BRANCH="next/v${RELEASED_VERSION}" | ||
git switch -C ${BRANCH} | ||
git add . | ||
git commit -m "Back to development" | ||
git push --set-upstream origin --force ${BRANCH} | ||
# This requires GH_TOKEN. | ||
url=$(gh pr create --title "Return to Development" --body "Release complete for v${RELEASED_VERSION}" | ||
# jq --null-input "{ text: "BufCLI Release for v${VERSION} has been drafted: ${url}" }" \ | ||
# curl -sSL -X POST -H "Content-Type: application/json" -d @- "${WEBHOOK_URL}" |
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