mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-11 07:00:25 +00:00
Update tools/publish.sh
This commit is contained in:
@@ -31,10 +31,12 @@ git diff --exit-code
|
||||
git diff --exit-code --staged
|
||||
|
||||
# Make sure the same release has not been created in the past.
|
||||
if gh release view "${tag}" >/dev/null; then
|
||||
if gh release view "${tag}" &>/dev/null; then
|
||||
bail "tag '${tag}' has already been created and pushed"
|
||||
fi
|
||||
|
||||
tags=$(git --no-pager tag)
|
||||
if [[ -n "${tags}" ]]; then
|
||||
# Make sure the same release does not exist in CHANGELOG.md.
|
||||
release_date=$(date --utc '+%Y-%m-%d')
|
||||
if grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" CHANGELOG.md; then
|
||||
@@ -56,6 +58,7 @@ fi
|
||||
if ! grep -Eq "^\\[${version//./\\.}\\]: " CHANGELOG.md; then
|
||||
bail "failed to update CHANGELOG.md"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure that a valid release note for this version exists.
|
||||
# https://github.com/taiki-e/parse-changelog
|
||||
@@ -63,9 +66,11 @@ echo "============== CHANGELOG =============="
|
||||
parse-changelog CHANGELOG.md "${version}"
|
||||
echo "======================================="
|
||||
|
||||
if [[ -n "${tags}" ]]; then
|
||||
# Create a release commit.
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Release ${version}"
|
||||
fi
|
||||
|
||||
tools=(
|
||||
cargo-hack
|
||||
|
||||
Reference in New Issue
Block a user