Some checks failed
Texture Pack Packaging and Release / package-and-release (push) Failing after 7s
105 lines
3.0 KiB
YAML
105 lines
3.0 KiB
YAML
name: Texture Pack Packaging and Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
jobs:
|
|
package-and-release:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up ZIP tool
|
|
run: sudo apt-get install zip -y
|
|
|
|
- name: Create version info
|
|
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
|
|
else
|
|
echo "New version: $DATE" >> versions.txt
|
|
fi
|
|
|
|
echo "Pack version: $DATE"
|
|
|
|
- name: Package texture pack
|
|
run: |
|
|
# Create ZIP with consistent name
|
|
zip -r MineDivinity-Pack.zip \
|
|
pack.mcmeta \
|
|
pack.png \
|
|
assets/ \
|
|
LICENSE \
|
|
README.md
|
|
|
|
# Generate SHA1 checksum
|
|
sha1sum MineDivinity-Pack.zip > MineDivinity-Pack.zip.sha1
|
|
|
|
echo "ZIP file created: MineDivinity-Pack.zip"
|
|
echo "SHA1 checksum generated"
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "Gitea Actions"
|
|
git config --global user.email "actions@gitea"
|
|
git remote set-url origin https://x:${{ secrets.TOKEN }}@git.devbeni.lol/MineDivinity/pack.git
|
|
|
|
- name: Commit version update
|
|
run: |
|
|
git pull origin main
|
|
git add versions.txt
|
|
git commit -m "Update to version ${{ env.VERSION }} [skip ci]"
|
|
git push origin main
|
|
|
|
- name: Create Release
|
|
id: create-release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
|
with:
|
|
tag_name: v${{ env.VERSION }}
|
|
release_name: MineDivinity Pack v${{ env.VERSION }}
|
|
body: |
|
|
Minecraft Texture Pack Release
|
|
Version: ${{ env.VERSION }}
|
|
|
|
Contents:
|
|
- Packaged texture pack (consistent filename)
|
|
- SHA1 checksum for verification
|
|
- Version history in versions.txt
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Upload Artifacts
|
|
run: |
|
|
echo "Uploading texture pack..."
|
|
curl -sSL \
|
|
-X POST \
|
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
|
-H "Content-Type: application/zip" \
|
|
--data-binary @MineDivinity-Pack.zip \
|
|
"${{ steps.create-release.outputs.upload_url }}?name=MineDivinity-Pack.zip"
|
|
|
|
echo "Uploading SHA1 checksum..."
|
|
curl -sSL \
|
|
-X POST \
|
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
|
-H "Content-Type: text/plain" \
|
|
--data-binary @MineDivinity-Pack.zip.sha1 \
|
|
"${{ steps.create-release.outputs.upload_url }}?name=MineDivinity-Pack.zip.sha1"
|
|
|
|
echo "Artifacts uploaded successfully" |