9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/scripts/prepareRelease.sh
Dreeam 6345e99c97 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@d6ac530c [ci/skip] ignore deprecation or removal warnings
PurpurMC/Purpur@8c293626 [ci/skip] ignore deprecation or removal warnings
PurpurMC/Purpur@65b1288b Updated Upstream (Paper)
PurpurMC/Purpur@6be184ec Merge branch 'ver/1.21.4' into ver/1.21.5
PurpurMC/Purpur@0311dfcd Updated Upstream (Paper)
PurpurMC/Purpur@ecd0d703 Updated Upstream (Paper)
PurpurMC/Purpur@c5bb590f [ci/skip] Mention API Checks for CONTRIBUTING.md
PurpurMC/Purpur@96f0ee1e Add check for max growth age special case (#1652)
PurpurMC/Purpur@d4af7947 Add configurable smooth snow accumulation (#1651)
PurpurMC/Purpur@51aafbc7 Final 1.21.4 Upstream (Paper)
PurpurMC/Purpur@ba521eb6 read & write spawn data properly for placing spawners option
PurpurMC/Purpur@751d8388 fix color signs not working properly
PurpurMC/Purpur@f5a9280b Merge branch 'ver/1.21.4' into ver/1.21.5
PurpurMC/Purpur@f8450874 Updated Upstream (Paper)
2025-04-14 11:07:43 -04:00

107 lines
2.5 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
IS_EOL=false
IS_UNSUPPORTED=false
IS_DEV=true
JAR_NAME="leaf-1.21.5"
CURRENT_TAG="ver-1.21.5"
RELEASE_NOTES="release_notes.md"
# Branch name
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "✨Current branch: $CURRENT_BRANCH"
# Latest tag name
LATEST_TAG=$(git describe --tags --abbrev=0)
if [ -z $LATEST_TAG ]; then
LATEST_TAG=$(git rev-list --max-parents=0 HEAD)
echo "⚠No previous release found. Using initial commit."
else
echo "✨Latest tag: $LATEST_TAG"
fi
# Commit of the latest tag
LAST_RELEASE_COMMIT=$(git rev-list -n 1 $LATEST_TAG)
echo "✨Last release commit: $LAST_RELEASE_COMMIT"
# Commits log
COMMIT_LOG=$(git log $LAST_RELEASE_COMMIT..HEAD --pretty=format:"- [\`%h\`](https://github.com/${GITHUB_REPO}/commit/%H) %s (%an)")
if [ -z $COMMIT_LOG ]; then
COMMIT_LOG="No new commits since $LATEST_TAG."
else
echo "✅Commits log generated"
fi
# Release notes header
echo "" >> $RELEASE_NOTES
# Commits log
{
echo "### 📜 Commits:"
echo ""
echo "$COMMIT_LOG"
echo ""
echo "### 🔒 Checksums"
} >> $RELEASE_NOTES
# Get checksums
file="./$JAR_NAME-${BUILD_NUMBER}.jar"
if [ -f $file ]; then
MD5=$(md5sum $file | awk '{ print $1 }')
SHA256=$(sha256sum $file | awk '{ print $1 }')
FILENAME=$(basename $file)
{
echo "| | $FILENAME |"
echo "| --------- | --------- |"
echo "| MD5 | $MD5 |"
echo "| SHA256 | $SHA256 |"
} >> $RELEASE_NOTES
echo "🔒Checksums calculated:"
echo " MD5: $MD5"
echo " SHA256: $SHA256"
else
echo "⚠No artifacts found." >> $RELEASE_NOTES
fi
# EOL warning
if [ $IS_EOL = true ]; then
{
echo ""
echo "> [!WARNING]"
echo "> This version of Leaf is end-of-life and will only receive critical bugfixes from upstream."
echo "> Update to latest version and gain better performance!"
} >> $RELEASE_NOTES
fi
# Unsupported warning
if [ $IS_UNSUPPORTED = true ]; then
{
echo ""
echo "> [!CAUTION]"
echo "> This version of Leaf is unsupported and will not receive any bugfixes."
echo "> Use at your own risk!"
} >> $RELEASE_NOTES
fi
# Dev build warning
if [ "$IS_DEV" = true ]; then
{
echo ""
echo "> [!WARNING]"
echo "> This is the early dev build, only for testing usage."
echo "> Do not use in the production environment!"
} >> $RELEASE_NOTES
fi
# Delete current release tag
if git show-ref --tags $CURRENT_TAG --quiet; then
{
gh release delete $CURRENT_TAG --cleanup-tag -y -R "${GITHUB_REPO}"
}
fi
echo "🚀Ready for release"