Refactor code structure for improved readability and maintainability
All checks were successful
Texture Pack Packaging and Release / package-and-release (push) Successful in 56s

This commit is contained in:
2025-06-23 21:21:20 +02:00
parent 21c48a6486
commit c224f614ad
5 changed files with 1110 additions and 21 deletions

View File

@ -77,29 +77,24 @@ jobs:
git config --global user.email "actions@gitea"
git remote set-url origin https://x:${{ secrets.TOKEN }}@git.devbeni.lol/MineDivinity/pack.git
- name: Commit updates
- name: Delete existing tag if present
run: |
git add versions.txt pack/pack.mcmeta MineDivinity-Pack.zip MineDivinity-Pack.sha1.txt
git commit -m "Update to version ${{ env.VERSION }} [skip ci]"
git pull origin main --rebase
git push origin main
- name: Delete existing release
run: |
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.TOKEN }}" "https://git.devbeni.lol/api/v1/repos/MineDivinity/pack/releases/tags/latest" | jq .id)
if [ "$RELEASE_ID" != "null" ] && [ ! -z "$RELEASE_ID" ]; then
echo "Deleting release with ID $RELEASE_ID"
curl -s -X DELETE -H "Authorization: token ${{ secrets.TOKEN }}" "https://git.devbeni.lol/api/v1/repos/MineDivinity/pack/releases/$RELEASE_ID"
else
echo "No existing 'latest' release found."
if git rev-parse v${{ env.VERSION }} >/dev/null 2>&1; then
git tag -d v${{ env.VERSION }}
git push --delete origin v${{ env.VERSION }} || true
fi
- name: Update latest tag
- name: Create Tag
run: |
git tag -d latest || true
git push --delete origin latest || true
git tag -a latest -m "Release v${{ env.VERSION }}"
git push origin latest
git tag -a v${{ env.VERSION }} -m "Release v${{ env.VERSION }}"
git push origin v${{ env.VERSION }}
- name: Commit updates
run: |
git pull origin main
git add versions.txt pack/pack.mcmeta MineDivinity-Pack.zip
git commit -m "Update to version ${{ env.VERSION }} [skip ci]"
git push origin main
- name: Create Release
id: create-release
@ -107,8 +102,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: latest
release_name: MineDivinity Pack (Latest) v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
release_name: MineDivinity Pack v${{ env.VERSION }}
body: |
Minecraft Texture Pack Release
Version: ${{ env.VERSION }}