Fix goreleaser issues and add new goreleaser action.

Fix goreleaser script's bug.
Add a new Github action to verify goreleaser related modification.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-11 16:27:58 +08:00
parent bacec117b9
commit e779cd2b76
6 changed files with 46 additions and 10 deletions

View File

@@ -41,6 +41,10 @@ else
export GIT_TREE_STATE=dirty
fi
# Verify .goreleaser.yml format first.
echo "Start to verify .goreleaser.yml format"
goreleaser check
# $PUBLISH must explicitly be set to 'TRUE' for goreleaser
# to publish the release to GitHub.
if [[ "${PUBLISH:-}" != "TRUE" ]]; then
@@ -48,12 +52,10 @@ if [[ "${PUBLISH:-}" != "TRUE" ]]; then
goreleaser release \
--clean \
--release-notes="${RELEASE_NOTES_FILE}" \
--skip-publish \
--config goreleaser.yaml
--snapshot # Generate an unversioned snapshot release, skipping all validations and without publishing any artifacts (implies --skip-publish, --skip-announce and --skip-validate)
else
echo "Getting ready to publish"
goreleaser release \
--clean \
--release-notes="${RELEASE_NOTES_FILE}"
--config goreleaser.yaml
fi

View File

@@ -1,6 +0,0 @@
git:
# What should be used to sort tags when gathering the current and previous
# tags if there are more than one tag in the same commit.
#
# Default: `-version:refname`
tag_sort: -version:creatordate