6 Commits

Author SHA1 Message Date
f640b24ecd Refactor versioning logic to increment version numbers and update versions.txt
All checks were successful
Texture Pack Packaging and Release / package-and-release (push) Successful in 9s
2025-06-22 03:10:14 +02:00
5b3e567cc5 Merge branch 'main' of https://git.devbeni.lol/MineDivinity/pack
Some checks failed
Texture Pack Packaging and Release / package-and-release (push) Failing after 6s
2025-06-22 03:08:44 +02:00
2c85007d5e Refactor texture pack packaging to ensure proper structure and include SHA1 checksum for verification 2025-06-22 03:08:43 +02:00
c1735e7fd6 Update to version 2025.06.22 [skip ci] 2025-06-22 01:07:52 +00:00
94f82e8768 Merge branch 'main' of https://git.devbeni.lol/MineDivinity/pack
Some checks failed
Texture Pack Packaging and Release / package-and-release (push) Failing after 7s
2025-06-22 03:07:43 +02:00
77295a12e3 Add missing files to texture pack ZIP packaging 2025-06-22 03:07:41 +02:00
2 changed files with 52 additions and 30 deletions

View File

@ -24,26 +24,46 @@ jobs:
- name: Set up ZIP tool
run: sudo apt-get install zip -y
- name: Create version info
- name: Calculate version number
id: version
run: |
# Get current date for versioning
DATE=$(date +"%Y.%m.%d")
echo "VERSION=$DATE" >> $GITHUB_ENV
# Update versions.txt
if [ ! -f versions.txt ]; then
echo "Initial version: $DATE" > versions.txt
# Read current version from versions.txt or initialize
if [ -f versions.txt ]; then
CURRENT_VERSION=$(tail -1 versions.txt | awk '{print $NF}')
else
echo "New version: $DATE" >> versions.txt
CURRENT_VERSION="1.0.0"
echo "Initial version: $CURRENT_VERSION" > versions.txt
fi
echo "Pack version: $DATE"
# Split version into components
MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
# Increment version according to rules
if [ $PATCH -lt 9 ]; then
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
else
NEW_MINOR=$((MINOR + 1))
NEW_VERSION="$MAJOR.$NEW_MINOR.0"
fi
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "New version: $NEW_VERSION" >> versions.txt
echo "New version calculated: $NEW_VERSION"
- name: Package texture pack
run: |
zip -r MineDivinity-Pack.zip \
pack/ \
# Create proper Minecraft pack structure
mkdir -p temp/pack
cp pack/pack.mcmeta temp/pack/
cp pack/pack.png temp/pack/
cp -r pack/assets/ temp/pack/
# Create ZIP with correct structure
cd temp && zip -r ../MineDivinity-Pack.zip pack/
cd ..
# Generate SHA1 checksum
sha1sum MineDivinity-Pack.zip > MineDivinity-Pack.sha1.txt
@ -57,20 +77,23 @@ jobs:
git config --global user.email "actions@gitea"
git remote set-url origin https://x:${{ secrets.TOKEN }}@git.devbeni.lol/MineDivinity/pack.git
- name: Delete existing tag if present
run: |
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: Create Tag
run: |
git tag -a v${{ env.VERSION }} -m "Release v${{ env.VERSION }}"
git push origin v${{ env.VERSION }}
- name: Commit version update
run: |
# Pull changes and handle potential merge conflicts
git pull origin main || true
# If conflict occurs, keep both version entries
if git diff --name-only --diff-filter=U | grep -q "versions.txt"; then
git checkout --ours versions.txt
echo "New version: ${{ env.VERSION }}" >> versions.txt
git add versions.txt
fi
git pull origin main
git add versions.txt
git commit -m "Update to version ${{ env.VERSION }} [skip ci]" || echo "No changes to commit"
git commit -m "Update to version ${{ env.VERSION }} [skip ci]"
git push origin main
- name: Create Release
@ -84,6 +107,10 @@ jobs:
body: |
Minecraft Texture Pack Release
Version: ${{ env.VERSION }}
Includes:
- Properly structured texture pack
- SHA1 checksum for verification
draft: false
prerelease: false

View File

@ -1,6 +1 @@
New version: 2025.06.22
New version: 2025.06.22
New version: 2025.06.22
New version: 2025.06.22
New version: 2025.06.22
New version: 2025.06.22
1.0.0