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