|
|
@ -24,34 +24,49 @@ jobs:
|
|
|
|
- name: Set up ZIP tool
|
|
|
|
- name: Set up ZIP tool
|
|
|
|
run: sudo apt-get install zip -y
|
|
|
|
run: sudo apt-get install zip -y
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create version info
|
|
|
|
- name: Calculate version number
|
|
|
|
id: version
|
|
|
|
id: version
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
# Get current date for versioning
|
|
|
|
# Read current version from versions.txt or initialize
|
|
|
|
DATE=$(date +"%Y.%m.%d")
|
|
|
|
if [ -f versions.txt ]; then
|
|
|
|
echo "VERSION=$DATE" >> $GITHUB_ENV
|
|
|
|
CURRENT_VERSION=$(tail -1 versions.txt | awk '{print $NF}')
|
|
|
|
|
|
|
|
|
|
|
|
# Update versions.txt
|
|
|
|
|
|
|
|
if [ ! -f versions.txt ]; then
|
|
|
|
|
|
|
|
echo "Initial version: $DATE" > versions.txt
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "New version: $DATE" >> versions.txt
|
|
|
|
CURRENT_VERSION="1.0.0"
|
|
|
|
|
|
|
|
echo "Initial version: $CURRENT_VERSION" > versions.txt
|
|
|
|
fi
|
|
|
|
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
|
|
|
|
- name: Package texture pack
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
# Create ZIP with consistent name
|
|
|
|
# Create proper Minecraft pack structure
|
|
|
|
zip -r MineDivinity-Pack.zip \
|
|
|
|
mkdir -p temp/pack
|
|
|
|
pack.mcmeta \
|
|
|
|
cp pack/pack.mcmeta temp/pack/
|
|
|
|
pack.png \
|
|
|
|
cp pack/pack.png temp/pack/
|
|
|
|
assets/ \
|
|
|
|
cp -r pack/assets/ temp/pack/
|
|
|
|
LICENSE \
|
|
|
|
|
|
|
|
README.md
|
|
|
|
# Create ZIP with correct structure
|
|
|
|
|
|
|
|
cd temp && zip -r ../MineDivinity-Pack.zip pack/
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
|
|
# Generate SHA1 checksum
|
|
|
|
# Generate SHA1 checksum
|
|
|
|
sha1sum MineDivinity-Pack.zip > MineDivinity-Pack.zip.sha1
|
|
|
|
sha1sum MineDivinity-Pack.zip > MineDivinity-Pack.sha1.txt
|
|
|
|
|
|
|
|
|
|
|
|
echo "ZIP file created: MineDivinity-Pack.zip"
|
|
|
|
echo "ZIP file created: MineDivinity-Pack.zip"
|
|
|
|
echo "SHA1 checksum generated"
|
|
|
|
echo "SHA1 checksum generated"
|
|
|
@ -62,20 +77,23 @@ jobs:
|
|
|
|
git config --global user.email "actions@gitea"
|
|
|
|
git config --global user.email "actions@gitea"
|
|
|
|
git remote set-url origin https://x:${{ secrets.TOKEN }}@git.devbeni.lol/MineDivinity/pack.git
|
|
|
|
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
|
|
|
|
- name: Commit version update
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
# Pull changes and handle potential merge conflicts
|
|
|
|
git pull origin main
|
|
|
|
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 add versions.txt
|
|
|
|
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
|
|
|
|
git push origin main
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
- name: Create Release
|
|
|
@ -90,10 +108,9 @@ jobs:
|
|
|
|
Minecraft Texture Pack Release
|
|
|
|
Minecraft Texture Pack Release
|
|
|
|
Version: ${{ env.VERSION }}
|
|
|
|
Version: ${{ env.VERSION }}
|
|
|
|
|
|
|
|
|
|
|
|
Contents:
|
|
|
|
Includes:
|
|
|
|
- Packaged texture pack (consistent filename)
|
|
|
|
- Properly structured texture pack
|
|
|
|
- SHA1 checksum for verification
|
|
|
|
- SHA1 checksum for verification
|
|
|
|
- Version history in versions.txt
|
|
|
|
|
|
|
|
draft: false
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
|
|
|
@ -112,7 +129,7 @@ jobs:
|
|
|
|
-X POST \
|
|
|
|
-X POST \
|
|
|
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
|
|
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
|
|
|
-H "Content-Type: text/plain" \
|
|
|
|
-H "Content-Type: text/plain" \
|
|
|
|
--data-binary @MineDivinity-Pack.zip.sha1 \
|
|
|
|
--data-binary @MineDivinity-Pack.sha1.txt \
|
|
|
|
"${{ steps.create-release.outputs.upload_url }}?name=MineDivinity-Pack.zip.sha1"
|
|
|
|
"${{ steps.create-release.outputs.upload_url }}?name=MineDivinity-Pack.sha1.txt"
|
|
|
|
|
|
|
|
|
|
|
|
echo "Artifacts uploaded successfully"
|
|
|
|
echo "Artifacts uploaded successfully"
|